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

 
 

Share on Google+Share on Google+
SCJP Module-8 Question-3
Posted on: July 15, 2010 at 12:00 AM
Advertisement
The program given below will test your knowledge Thread and their execution in Java.

Given a sample code:

public class Test extends Thread {
static String name = "raj";

public static void main(String args[]) {
Test t = new Test();
t.testMethod(name);
System.out.print(" " + name);
}

public void testMethod(String name) {
start();
System.out.print(" method");
}

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

Which of the following statement is correct ?

(A) raj method run
(B) method raj run
(C) run method run
(D) run raj method

Answer:

(B) 

Advertisement

Related Tags for SCJP Module-8 Question-3:


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