更多JAVA程序设计试题
- 1请阅读下面的程序代码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();}}下列关于程序运行结果的描述中,正确的是()
- 2下列哪个是Java应用程序主类中正确的main方法?
- 3下列程序运行结果是( )interface InterfaceA{String s="good ";void f();}abstract class ClassA{abstract void g();}class ClassB extends ClassA implements InterfaceA{void g(){System.out.print(s);}public void f(){System.out.print(" "+s);}}public class E {public static void main(String[] args) {ClassA a=new ClassB();InterfaceA b=new ClassB();a.g();b.f();}}
- 4请阅读下面的程序代码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();}}下列关于程序运行结果的描述中,正确的是()
- 5LinkedList类的特点是()
- 6下列哪个说法是正确的?