Home Tutorial Java Scjp Part8 SCJP Module-8 Question-9

 
 

Share on Google+Share on Google+
SCJP Module-8 Question-9
Posted on: July 15, 2010 at 12:00 AM
Advertisement
The Sample program given below will check your understanding of thread execution in Java.

Given a sample code:

public class Test implements Runnable {
public static void main(String[] args) throws Exception {
Thread t = new Thread(new Test());
t.start();
System.out.print(" Started");
t.join();
System.out.print(" Joined");
}

public void run() {
System.out.print(" Run");
}
}

Which of the following statement is correct ?

(A) Print "Run Started Joined"
(B) Print "Started Run Joined"
(C) Print "Joined Started Run"
(D) Print "Joined Run Started"

Answer:

(B)

Advertisement

Related Tags for SCJP Module-8 Question-9:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 15, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com