现有: class TestApp{ public static void main (String[] args){ int [5] myarray={ 10, 11, 12, 13, 14); int sum=0; for (int x : myarray) sum+=x; System. out. println( "sum= "+sum); } } 上述程序运行后的结果是哪项?()
第1题:
class TestApp{ public static void main (String[ ] args){ for(int i=0;i<10;i++){ if(i==3) break; System.out.print (i); } } } 程序运行后的输出是哪项?()
第2题:
public class Yippee2{ stati cpublic void main(String[]yahoo){ for(intx=1;x
第3题:
A.ab
B.bc
C.abc
D.Compilation fails.
E.An exception is thrown at runtime.
第4题:
现有: class TestApp{ public static void main (String[] args){ for (int i=0; i
第5题:
Which two allow the class Thing to be instantiated using new Thing()?
第6题:
Which three demonstrate an “is a” relationship?()
第7题:
public class TestApp{ public int mymethod(){ try{ int i = 0; int j = 1 / i; System.out.println(“1”); }finally{ System.out.print(“4”); } return 1; } } 上述程序运行后的输出是哪项?()
第8题:
程序: class TestApp{ public static void main(String[] args){ System.out.println(multiply(2,3,4,5)); } public int multiply(int[] nums){ int result = 1; for(int x :nums) result *= x; return result; } } 程序运行后的输出是哪项?()
第9题:
现有: class TestApp{ public static void main (String[] args){ for (int i=0; i
第10题:
现有: interface Data {public void load();} abstract class Info {public abstract void load();} 下列类定义中正确使用Data和Info的是哪项?()