Join
Blogs
Questions
Videos
Tags
Members
Search
 
 
Create your own blog, earn points and get popular!

Thread

Megha's picture

What will be output on compiling and running the following code?

0
Your rating: None
  1. public class DemoThread extends Thread{
  2.    
  3.     public void run(String msg){
  4.         System.out.println("Thread Started: " + msg);
  5.     }
  6.    
  7.     public static void main(String args[]){
  8.         DemoThread thread = new DemoThread();
  9.         thread.start();
  10.     }    
  11. }
a. Program will not compile
b. Program will compile, but will not run.
Andr's picture

Intermediate Java Tutorial - Learning about Threads

Video Tutorial: 
See video
Syndicate content