How many times will the following code print "Welcome to Examveda"?int count = 0;do { System.out.println("Welcome to Examveda"); count++;} while (count < 10); 8 10 0 11 9 TRUE ANSWER : ? YOUR ANSWER : ?
Determine output:public class Test{ public static void main(String args[]){ int i; for(i = 1; i < 6; i++){ if(i > 3) continue ; } System.out.println(i); }} 5 4 2 3 6 TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following for loops will be an infinite loop? All of these for(i=0 ; i<1; i--) for(; ;) for(i=0; ; i++) TRUE ANSWER : ? YOUR ANSWER : ?
What will be the result?1. int i = 10;2. while(i++ <= 10){3. i++;4. }5. System.out.print(i); 12 10 13 Line 5 will be never reached. 11 TRUE ANSWER : ? YOUR ANSWER : ?
What all gets printed when the following program is compiled and run?public class Test{ public static void main(String args[]){ int i=0, j=2; do{ i=++i; j--; }while(j>0); System.out.println(i); }} None of these 1 The program does not compile because of statement "i=++i;" 2 0 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the result of compiling and runnig the following code:public class Test{ public static void main(String... args) throws Exception{ Integer i = 34; int l = 34; if(i.equals(l)){ System.out.println("true"); }else{ System.out.println("false"); } }} true false Compiler error None of these TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output?public class Test{ public static void main(String args[]){ int i = 1; do{ i--; }while(i > 2); System.out.println(i); }} None of these 1 0 -1 2 TRUE ANSWER : ? YOUR ANSWER : ?
What is the value of a[1] after the following code is executed?int[] a = {0, 2, 4, 1, 3};for(int i = 0; i < a.length; i++) a[i] = a[(a[i] + 3) % a.length]; 2 4 0 1 3 TRUE ANSWER : ? YOUR ANSWER : ?
What all gets printed when the following program is compiled and run.public class Test{ public static void main(String args[]){ int i, j=1; i = (j>1)?2:1; switch(i){ case 0: System.out.println(0); break; case 1: System.out.println(1); case 2: System.out.println(2); break; case 3: System.out.println(3); break; } }} 3 1 1 2 2 0 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following program?public class Test{ public static void main(String args[]){ int i = 0, j = 5 ; for( ; (i < 3) && (j++ < 10) ; i++ ){ System.out.print(" " + i + " " + j ); } System.out.print(" " + i + " " + j ); }} 0 6 1 7 2 8 3 8 0 6 1 5 2 5 3 5 Compilation Error 0 6 1 7 2 8 3 9 TRUE ANSWER : ? YOUR ANSWER : ?