A.a为引用类型的变量,b为值类型的变量
B.a为值类型的变量,b为引用类型的变量
C.a和b都是值类型的变量
D.a和b都是引用类型的变量
第1题
publicclassAAA{
publicstaticvoidmain(String[]args){
intm=0,n=0,t=1234;
try{m=Integer.parseInt("6666");
n=Integer.parseInt("89ab");
t=8888;
}
catch(NumberFormatExceptione){
System.out.println("发生异常");
}
System.out.println("m="+m+",n="+n+",t="+t);
}
}
运行结果:
第2题
Using system;
Class Example1
{
Public Static void main()
{
Int x=1,a=0,b=0;
Switch(x)
{
Case 0:b++,break;
Case 1:a++,break;
Case 2:a++,b++,break;
}
Console.Writeline(“a={0},b={1}”,a,b);
}
}
的输出结果是()
A.a=2,b=1
B.a=1,b=1
C.a=1,b=0
D.a=2,b=2
第3题
以下程序的运行结果是 class Person{ public Person(){ System.out.println(“this is a Person”); } } public class Teacher extends Person{ private String name=”tom”; public Teacher(){ System.out.println(“this is a teacher”); super(); } public static void main(String[] args){ Teacher teacher = new Teacher(); System.out.println(this.name); } }
A、this is a Person this is a teacher tom
B、this is a teacher this is a Person tom
C、运行出错
D、编译有两处错误
第4题
A、A.null---0 周星驰---27
B、B.null---27 周星驰---27
C、C.周星驰---0 null---27
D、D.周星驰---27 null ---27
第5题
A.101
B.6
C.5
D.4
第6题
A.101
B.6
C.5
D.4
第7题
A. 编译将产生错误
B. 编译时正确,但运行时将产生错误
C. 正确,输出0
D. 正确,输出?null
第8题
A.4321
B.0000
C.Anexceptionisthrownatruntime.
D.Compilationfailsbecauseofanerrorinline18.
第9题
A.0
B.1
C.2
D.3
第10题
A、当编译时会发生错误
B、编译不会发生错误但执行是会发生错误
C、输出结果为0
D、不会输出结果
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!