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

What will happen when you attempt to compile and run the following code?

  1. class MyThread implements Runnable
  2. {
  3.    public void run(int value)
  4.    {
  5.        for(int i=0;i<10;i++)
  6.        {
  7.            System.out.println("value = " + value);
  8.        }
  9.    }
  10. }

a. It will compile and throw runtime error.
b. It will compile and print value 10 times.
c. It will compile and run when start method is invoked.
d. The code will not compile.
Your rating: None Average: 3 (1 vote)
Share this
Anonymous's picture

ans d

ans d

Post new comment

1 + 5 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.