Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
15 Cards in this Set
- Front
- Back
Which method must be defined by a class implementing the java.lang.Runnable interface and serves as the path of execution for all threads? |
run() |
|
The following classes are defined in a program: class Base { public void show() { System.out.println("show() in Base called"); }} class Derived extends Base { public void show() { System.out.println("show() in Derived called"); } } What will be displayed when the following code is executed? Base b = new Derived(); b.show(); |
show() in Derived called |
|
The code in a thread that is different than the main/UI thread should directly manipulate user interface elements? |
False |
|
Each method in a class must have a unique name. |
False |
|
All interface methods must be declared as public when implemented in a clas |
True |
|
What method in the Thread class do you call to make the current thread cease executing for a specified amount of time? |
sleep() |
|
A Java class can implement _____________ interface(s). |
one or more than one |
|
To create an InputStream to read from a file on a Web server, you use the method __________ in the URL class. |
openStream(); |
|
What is used to declare a class named A with two generic types? |
public class A { ... },> |
|
What create and starts a thread? |
new Thread(new MyRunnable()).start(); |
|
java.util.ArrayList list = new java.util.ArrayList<>(); list.add("Apple"); java.util.ArrayList list2 = list;list.add("Banana"); list2.add("Orange"); System.out.println(list2); what is printed? |
[Apple, Banana, Orange] |
|
What exception is thrown by the read() method of InputStream class? |
IOException |
|
What is object serialization? |
Converting an object into a stream of bytes in order to store or transmit the object. |
|
What is an example of a class that cannot be extended? |
final class A { } |
|
What is the name of the method used to initiate execution of a thread? |
start() |