2、mponentdon?tallowmultiplelistenerstobeadd.D.none3:Give the following java class: public class Example{ static int x[]=new int[15]; public static void main(String args[]){ System.out.println(x[5]); } } Which statement is corrected? Givethefollowin
3、gjavaclass:publicclassExample{staticintx[]=newint[15];publicstaticvoidmain(Stringargs[]){System.out.println(x[5]);}}Whichstatementiscorrected?A.Whencompile,someerrorwilloccur.B.Whenrun,someerrorwilloccur.C.Outputiszero.D.Outputisnull.4:Give the following
4、 java source fragement: //point x public class Interesting{ //do something } Which statement is correctly Java syntax at point x? Givethefollowingjavasourcefragement://pointxpublicclassInteresting{//dosomething}WhichstatementiscorrectlyJavasyntaxa
5、tpointx?A.publicclassMyClass{//dootherthing…}B.staticintPI=3.14C.classMyClass{//dosomething…}D.none5:What will be the result of executing the following code? boolean a = true; boolean b = false; boolean c = true; if (a == true) if (b == true)
6、 if (c == true) System.out.println("Some things are true in this world"); else System.out.println("Nothing is true in this world!"); else if (a && (b = c)) System.out.println("It's too confusing to tell what is true and what is false");
7、 else System.out.println("Hey this won't compile"); Choices: Whatwillbetheresultofexecutingthefollowingcode?booleana=true;booleanb=false;booleanc=true;if(a==true)if(b==true)if(c==true)System.out.println("Somethingsaretrueinthisworld");elseSystem.