Monday 8 April 2013

JPC 1


public class Loop {
    public static void main(String[] args){
         int i=1;
         int j=5;

         for(;;){
             System.out.println(j>>>i);
         }
    }
}

What will be output of the above java program?

(a)2
   1
(b)2
   1
   0
(c)Infinite loop
(d)Compiler error

Answer: (c)

Because No Condition Check in For Loop.


No comments:

Post a Comment