Analyze the following code: public class Test implements Runnable{public static void main(String[] args){Test t = new Test(); t.start(); }public void run() { } }

Question:
Analyze the following code: public class Test implements Runnable{public static void main(String[] args){Test t = new Test(); t.start(); }public void run() { } }

1.The program compiles and runs fine.

2.The program does not compile because the start() method is not defined in the Test class.

3.The program compiles, but it does not run because the start() method is not defined.

4.The program compiles, but it does not run because the run() method is not implemented

Posted Date:-2021-10-25 05:37:20


More MCQS Questions and answers

Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!