SCJP Module-8 Question-1

This program will check your Thread concept in Java and prepare you for successful completion of SCJP examination.

 
 

Share on Google+Share on Google+

SCJP Module-8 Question-1

Ads

This program will check your Thread concept in Java and prepare you for successful completion of SCJP examination.

Given a sample code:

1    public class Test implements Runnable {
2    public void run() {
3    System.out.println("Inside run");
4    }

5    public static void main(String[] args) {
6    Thread t = new Thread();
7    t.start();
8    System.out.println("End of main");
}}

Which of the following statement is correct ?

(A) Print "Inside run"
(B) Print "Inside run" then "End of main"
(C) Print "End of main"
(D) Print "End of main" then "Inside run"

Answer:

(C)

Advertisements

Posted on: July 14, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles