MCQOPTIONS
Bookmark
Saved Bookmarks
→
Java Programming
→
Exceptions
→
Which two can be used to create a new Thread?..
1.
Which two can be used to create a new Thread?
A.
1 and 2
B.
2 and 3
C.
1 and 4
D.
3 and 4
Answer» D. 3 and 4
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
Under which conditions will a currently executing thread stop?
Which method must be defined by a class implementing the interface?
Which two can be used to create a new Thread?
Which two statements are true?
The following block of code creates a Thread using a Runnable target: Which of the following classes can be used to create the target, so that the preceding code compiles correctly?
Which class or interface defines the , ,and methods?
which of these will create and start this thread?
Which of the following line of code is suitable to start a thread ?
What will be the output of the program? public class SyncTest { public static void main (String [] args) { Thread t = new Thread() { Foo f = new Foo(); public void run() { f.increase(20); } }; t.start(); } } class Foo { private int data = 23; public void increase(int amt) { int x = data; data = x + amt; } } and assuming that data must be protected from corruption, what—if anything—can you add to the preceding code to ensure the integrity of data?
Thread synchronization is required because ___________
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply