更多JAVA程序设计试题
- 1请阅读下面的程序,选择正确的运行结果。class Demo{private static int x ;public static void main(String[] args){System.out.println(x++);}}
- 2下列关于成员变量默认值的描述中,错误的是()
- 33下列说法错误的是?
- 4请阅读下面的程序,程序的运行结果是()。class Person {String name;int age;public Person() {}public Person(String n, int a) {name = n;age = a;}public void show() {System.out.print(name + "---" + age +"");}}public class Test {public static void main(String[] args) {Person p1 = new Person();p1.show();Person p2 = new Person("周星驰", 27);p2.show();}}
- 5请阅读下面的程序,选择正确的运行结果。class Demo{private static int x ;public static void main(String[] args){System.out.println(x++);}}
- 6请阅读下面的程序代码Class Person{void say(){System.out.println("hello");}}class Example{public static void main(String[] args){Person p2 = new Person();Person p1 = new Person(); p2.say();p1.say();p2=null;p2.say();}}下列关于程序运行结果的描述中,正确的是()