Sunday, 20 February 2011

break and continue questions in java



break and continue keyword questions and answers in java

(1)



Which of the following jump statement is not supported by java?



(a) break

(b) goto

(c) continue

(d) return







Answer: (b)



(2)



public class BreakDemo {

    public static void main(String[] args){

         int j=1;

         for(int i=1;i<5;i++){

             j*=i;{

                 break;

             }

No comments:

Post a Comment