x
x=x
“x=”+5
编译报错
第1题:
阅读下列代码 public class Test{ public static void main(String args[]){ System.out.println(89>>1); } } 其运行结果是
A.44
B.45
C.88
D.90
第2题:
( 21 )阅读下列代码
public class Test2005{
public static void main(String args[]){
System.out.println((3>2) ? 4 : 5) ;
}
}
其运行结果是
A ) 2
B ) 3
C ) 4
D ) 5
第3题:
( 8 )阅读下列代码
public class Test2{
public static void main(String args[]){
System.out.println(5/2);}}
其执行结果是 【 8 】 。
第4题:
阅读下面代码 public class Test { public static void main(String[]args) { System.out.println(2>0?10:8); } } 其运行的结果是
A.2
B.0
C.10
D.8
第5题:
阅读下面代码: public class Test2005 { public static void main(String args[]) { System.out.println((3>2)? 4:5); } } 其运行结果是
A.2
B.3
C.4
D.5
第6题:
阅读下列代码 public class Test2005 { public static void main(String args[]){ System.out.pfintln(~(0xa5)&0xaa); } } 其运行结果是( )。
A.0xa5
B.10
C.0x50
D.0xaa
第7题:
A. 5
B. x=5
C. "x="+5
D. "x="5
第8题:
A. hello
B. hello2
C. 编译报错
D. 运行报错,不能将串与整数相加
第9题:
执行以下代码会输出什么结果?() public class Test { StringgetStr(String s){ return s + “hello”; } public static void main(String arg[]) { Test t= new Test(); System.out.println(t.getStr(“LiLei/n”)); } }
第10题:
阅读以下代码: public class Test{ public static void main(){ System.out.println(“x=”+x); } } 请问,代码运行的结果是?()
第11题:
Hello
good-bye
Hellogod-bye
代码不能编译
第12题:
null
-1
编译时出错
运行时报错
第13题:
( 20 )阅读下列代码
public class Test2005{
public static void main(String args[]){
System.out.println(~(0xa5)&0xaa) ;
}
}
其运行结果是
A ) 0xa5
B ) 10
C ) 0x50
D ) 0xaa
第14题:
( 22 )阅读下列代码
public class Test{
public static void main(String args[]){
System.out.println(89>>1) ;
}
}
其运行结果是
A ) 44
B ) 45
C ) 88
D ) 90
第15题:
下列代码的执行结果是public class Test{ public int aMethod(){ static int i=0; i++; System.out.println(i); } public static void main(String args[]){ Test test= new Test(); test. aMethod(); }}
A.编译错误
B.0
C.1
D.运行成功,但不输出
第16题:
阅读下面代码 public class Test { String s="One World One Dream"; public static void main(String[] args) { System.out.println(s); } } 其运行的结果是
A.args
B.World One Dream
C.s
D.编译时出错
第17题:
阅读下面程序 public class Test3 { public static void main(String[] args) { int x=3,y=4,z=5; String s="xyz": System.out.println(s+x+y+z); } } 程序运行的结果是
A.xyz12
B.xyz345
C.xyzxyz
D.12xyz
第18题:
A.12
B.012
C.10
D.3
第19题:
A. 7
B. 6
C. 5
D. 8
第20题:
以下程序调试结果为:
public class Test {
int m=5;
public void some(int x) {
m=x;
}
public static void main(String args []) {
new Demo().some(7);
}
}
class Demo extends Test {
int m=8;
public void some(int x) {
super.some(x);
System.out.println(m);
}
}
A.5
B.8
C.7
D.无任何输出
E.编译错误
第21题:
执行以下代码,输出结果的结果是? () public class Test{ public String[] ss = new String[5]; public static void main(String[] args){ System.out.println(ss[1]); } }
第22题:
现有: class Top { static int X=l; public Top() { x*=3; } } class Middle extends Top { public Middle() {x+=l; } public static void main(String [] args) { Middle m=new Middle(); System.out.println (x); } } 结果是什么?()
第23题:
x
x=x
“x=”+5
编译报错
第24题:
2
3
4
编译失败