下面程序段的输出结果为()。 A.a=true b=false b=true C=trueB.a=true b=false b=true
下面程序段的输出结果为()。
A.a=true b=false b=true C=true
B.a=true b=false b=true e=false
C.a=true b=true b=true C=false
D.a=false b=false b=true C=false
下面程序段的输出结果为()。
A.a=true b=false b=true C=true
B.a=true b=false b=true e=false
C.a=true b=true b=true C=false
D.a=false b=false b=true C=false
下面程序段的输出结果为()。 pubUCClassTeS { public static voidmain(StringargS[]) { booleaha,b,c; a=(3<5); b=(a==tme); System.Out.phntln("a="+a+"b="+b); c=(b==false); SyStem.out.println("b="+b+"C="+c); } }
A.a=tme b=falSe
B.a=true b=false b=true c=false b=true C=tme
C.a=true b=true
D.a=falSe b=false b=true c=falSe b=tme c=falSe
3下面程序段的输出结果为()。 mblic class Test public static void main(String args[]) { boolean a,b,c; a=(3<5); b=(a==true); System.out.println("a="+a+"b="+b); c=(b=false); System.out.println("b="+b+"c="+c); } }
A.a=true b=false b=true c=false
B.a=true b=false b=true c=true
C.a=true b=true b=true c=false
D.a=false b=false b=true c=false
3下面程序段的输出结果为()。public class Test{ int a, b; Test() { a=100; b=200; } Test(int x, int y) { a=x; b=y; } public static void main(String args[]) { Test Obj 1 = new Test(12,45 ); System.out.println("a="+Obja+" b="+Objb); Test Obj2 = new Test(); System.out.println("a="+Obja+" b="+Objb); }}
A.a=100 b=200 a=12 b=45
B.a=12 b=45 a=100 b=200
C.a=12 b=200 a=100 b=45
D.a=100 b=45 a=12 b=200
下面程序段的输出结果为 public class Test { int a,b; Test() { a=100; b=200; } Test(int x,int y) { a=x; b=y; } public static void main(String args[]) { Test Obj1=new Test(12,45); System.out.println(”a=”+Obj 1.a+” b=”+Obj 1.b); Test Obj2=new Test(); System.out.println(”a=”+Obj 2.a+” b=”+Obj 2.b); } }
A.a=100 b=200 a=12 b=45
B.a=12 b=45 a=100 b=200
C.a=12 b=200 a=100 b=45
D.a=100 b=45 a=12 b=200
下面程序段的输出结果为 Print"10+20=" PrintlO+20 Print"20+20=" PrinflO+20
A.10+20=30 20+20=40
B.10+20= 30 20+20= 40
C.10+20 20+20
D.10+20=30 20+20= 40
下面程序段的输出结果为 public class MyClass { public static void main(String args[]) { String s="Helto! How are you?"; System.out.println(s.lastlndexOf("o",16)); } }
A.16
B.o
C.u
D.17
若score分别赋值为99和77,下面程序段分别输出什么结果?
ifscore>=90:
print('A')
elifscore>=80:
print('B')
elifscore>=70:
print('C')
elifscore>=60:
print('D')
else:
print('F')
下面程序段的输出结果为 package test; public class ClassA { int x=20; static int y=6; public static void main(String args[]) { ClassB b=new ClassB(); b.go(10); System.out.println("x="+b.x); } } class ClassB { int x; void go(int y) { ClassA a=new ClassA(); x=a.y; } }
A.x=10
B.x=20
C.x=6
D.编译不通过