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

 
 

SCJP Module-8 Question-5
Posted on: July 15, 2010 at 12:00 AM
The program given below will test your understanding of Thread execution and thread class in Java.

Given a sample code:

1    public class Test4 extends Thread{
2    public static void main(String args[]){
3    Test4 b = new Test4();
4    b.run();
5    }
6    public void start(){
7    System.out.println("start");
8    }}

Which of the following statement is correct ?

(A) Print start.
(B) Compiled successfully but no result.
(C) Raise Runtime exception.
(D) Compilation error at line no 4.

Answer:

(B)

Related Tags for SCJP Module-8 Question-5:


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.