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

What happens when you compile and run the following code?

  1. public class Demo{
  2.        public static void main (String args []){
  3.            /*
  4.             while (true){
  5.                     Demo d = new Demo();
  6.                     System.out.println("Demo created");
  7.             }
  8.             /* … Will print Hello world */
  9.            System.out.println ("Hello World");
  10.        }
  11. }
a. The code will not compile
b. The code will compile but goes into infinite loop
c. The code will compile but will not produce any output
d. None of the above
No votes yet
Share this
Anonymous's picture

the answer is d.It will print

the answer is d.It will print Hello World.
Anonymous's picture

ans d

ans d
Anonymous's picture

Not an actual java

Not an actual java program!!!!
Anonymous's picture

http://www.Idonthaveasite.com

http://www.Idonthaveasite.com - Nosite Excellent post! Really loved it, havent seen an artice this good in a while.

Post new comment

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