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.
(B)
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.