下面程序的运行结果()System.out.println(1+1+”1″)
A. 111
B. 编译错误
C. 21
D. 3
查看答案
下面程序的运行结果为?public static void main(String[ ] args ) {int x = 30;int [ ] numbers = new int[x];x = 60;System.out.println(numbers.length ) ;}()
A. 30
B. 60
C. 20
D. 50
下列代码执行结果是()public class Rectangle {public int width = 3;public int height = 4;public int area(){return width * height;}public static void main(String args[]) {Rectangle rec
A. 15
B. 有编译错误,程序不能运行
C. 12
D. 0
在Java中,下面对于构造方法的描述正确的是()
A. 类必须显式定义构造方法
B. 构造方法的返回类型是void
C. 构造方法和类有相同的名称,并且不能带任何形参
D. 一个类可以定义多个构造方法
下面程序段的运行结果是()public static void main(String[] args) {String str = “null”;if (str == null) {System.out.println(“null”);}else if (str.length()== 0) {System.out.println(“zero”);
B. zero
C. some
D. Compilation fails