Hi folks, I have some doubts on the answers to these questions. Hoping you could clarify'em...Thanks
What is required is to check the correct statements of each quesiton.
1-Which correctly create an array of five empty Strings?
A.String a [] = new
String [5]; for (int i = 0; i < 5; a[i++] = "");
B.String [] a = new String[5]; for (int i = 0; i < 5; a[i++] = null);
2-What kind of reader do you use to handle ASCII code?
A.BufferedReader
B.ByteArrayReader
C.PrintWriter
D.InputStreamReader
E.FilterReader
3-Choose the correct ones about
thread:
A.When JVM exists the main method, it will stop only after all the threads are
stopped.
B.if there are multiple threads, reading or writing of data of class is inconsitent.
4-Which statements are true about listeners?
A.Most components allow multiple listeners to be added.
B.A copy of the original event is passed into a listener method.
C.A copy of the refrence of the Original event is passed to the listener method.
5-What might cause the current thread to stop executing.
A.An InterruptedException is thrown.
B.The thread executes a wait() call.
C.The thread constructs a new Thread.
D.A thread of higher priority becomes ready.
E.The thread executes a waitforID() call on a MediaTracker.
6-Which statements are true about threads?
A.Invoking the suspend() stops a thread so that it cannot be restarted
B.The
Java Interpreter's natural exit occurs when no non daemon threads
C.Uncoordinated changes to shared data by multiple threads may result in the
data being read, or left, in an inconsistent state.
D.Most components allow multiple listeners to be added.
7- What is the method used to schedule a thread for execution, is it start() or run()?
8-Which of the following are FilterInputStreams?
A.DataInputStream
B.LineNumberInputStream
C.ByteArrayInputStream
D.BufferedInputStream
9-What does the java runtime option -cs do?
A.check source with debug report
B.clear classes that are existing when starting compilation.
C.check if the source is newer when loading classes.
10-What is the target in an Event?
A.The Object() where the event came from.
B.The Object() where the event is destined for.
C.What the Object() that generated the event was doing.