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

 
 

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

Given a sample code:

class Test extends Thread {
public void run() {
System.out.println("One");
System.out.println("Two");
}

private void method() {
System.out.println("Three");
}

public static void main(String args[]) {
Test t = new Test();
t.method();
t.start();
}
}

Which of the following statement is correct ?

(A) Print One Two Three
(B) Print Two Three One
(C) Print Three One Two
(D) Print Three One Two

Answer:

(D)

Advertisement

Related Tags for SCJP Module-8 Question-10:


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