Who is Donald Kroodsma?
A.The author of the book called The Singing Life of Birds.
B.The scientist of a program called The Singing Life of Birds.
C.The author of the magazine called The Singing Life of Birds.
D.The professor of a University studying The Singing Life of Birds.
第1题
public class ChangeStrDemo { public static void changeStr(String str){ str="welcome"; } public static void main(String[] args) { String str="home"; changeStr(str); System.out.println(str); } }给出程序的运行结果()
A、welcome
B、home
C、无输出
第2题
有如下程序: public class Sun { public static void main(String args[ ]) { int s=0; int i=1; while (i<=100) { s=s+i; } System.out.println(s); } } 运行后的结果是()。
A.5050
B.5051
C.死循环,直到溢出
D.无穷大的数
第3题
有如下程序 public class Sun { public static void main(String args[ ]) { int a=2,b=1,c=2; if(a<B) if(b<0) if(c<0) c=0; else C++; System.out.println(C) ; } } 上述程序的运行结果是()。
A.0
B.1
C.2
D.3
第4题
有如下程序: public class Sun { public static void main(String args[ ]) { int s=0; int i=1; while(i<=100) { s=s+i; } System.out.println(s); } } 运行后的结果是()。
A.5050
B.5051
C.死循环,直到溢出
D.无穷大的数
第5题
下面程序段的输出结果是______。 public class ex46 { public static void main(String args[]) { String str="Hello,"; str = str + "Guys!"; System.out .println (str); } }
A.Hello, Guys!
B.Guys!
C.Hello,
D.编译不通过
第6题
有如下程序 public class Sun { public static void main(String args[ ]) { int x=1,a=0,b=0; switch(x) { case 0:b++; case 1:a++; case 2: a++; b++; } System.out.println("a="+a+","+"b="+B) } }该程序的输出结果是()。
A.a=2,b=1
B.a=1,b=1
C.a=1,b=0
D.a=0,b=0
第7题
有以下程序 public class Sun { public static void main(string args[ ]) { int a, b; for(a=1, b=1; a<=100; a++) { if(b>=10} break; if (b%3 1) { b+=3; continue; } } System.cut.println(A) ; } } 执行后的输出结果是()。
A.101
B.6
C.5
D.4
第8题
有如下程序 public class Sun { public static void main(String args[ ]) { int x=0; int n=0; while(x<50) { x=(x+2)*(x+3); n=n+1; } System.out.println(n+"和"+x); } } 上述程序的运行结果是()。
A.1和0
B.2和72
C.3和50
D.4和168
第9题
有如下程序 public class Sun { public static void main (String args[ ]) { int x=0; int n=0; while (x<50) { x=(x+2)*(x+3); n=n+1; System.out.println (n+"和"+x); 上述程序的运行结果是()。
A.1和0
B.2和72
C.3和50
D.4和168
第10题
下面程序的输出结果是()。 public class Sun { public static void main(String args[ ]) { int n=4 ,sum=0; while(n>0) { sum+=n; n--; } System.out.println("sum is "+sum); } }
A.sum is 10
B.sum is 4
C.10
D.4
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!