Sunday 20 February 2011

java scjp questions and answers



Objective type questions for preparation of scjp exam and answers in java



(1)




public class Loop {

    public static void main(String[] args){

       

    for(int i=0;false;i++){

             System.out.println("java");

         }

    }

}



What will be output of above program?



(a)java

(b) Null

(c)It will not print anything.

(d)Compiler error













Answer: (d)



(2)

No comments:

Post a Comment