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

 
 

SCJP Module-8 Question-10
Posted on: July 15, 2010 at 12:00 AM
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)

Related Tags for SCJP Module-8 Question-10:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.