题目内容

System.out.println("5" + 2);的输出结果应该是( )

A. 52
B. 7
C. 2
D. 编译错

查看答案
更多问题

A variable defined inside a method is referred to as ()

A. a global variable
B. a method variable
C. a block variable
D. a local variable

A派生出子类B,B派生出子类C,并且在Java源代码中有如下声明:A a0=new A();A a1 =new B();A a2=new C();问以下哪个说法是正确的? ().

A. 只有第1行能通过编译3行的声明都是正确的
B. 第1、2行能通过编译,但第3行编译出错
C. 第1、2、3行能通过编译,但第2、3行运行时出错
D. 第1行、第2行和第3行的声明都是正确的

45 / 4的值为?().

A. 10
B. 11
C. 11.25
D. 12

有如下代码://A.javaclass A {int x;public A(int x){this.x=x;}}//B.javaclass B extends A{String name;public B(String name){x=10;this.name=name;}public static void main(String[] args){B b=new B("tom");System.out.println(b.name +b.x);}}以下说法正确的是().

A. 编译B通过,运行B,输出:tom10;
B. 编译B通过,运行B失败,因为b.name +b.x中字符串不能与整型相加
C. 编译B失败,因为b.name +b.x中字符串不能与整型相加
D. 编译B失败,因为A中没有无参构造方法

答案查题题库