问题: 1. interface A { public void aMethod(); } 2. interface B { public void bMethod(); } 3. interface C extends A,B { public void cMethod(); } 4. class D implements B { 5. public void bMethod() { } 6. } 7. class E extends D implements C { 8. public void aMethod() { } 9. public void bMethod() { } 10. public void cMethod() { } 11. } What is the result?() A、 Compilation fails because of an error in line 3.B、 Compilation fails because of an error in line 7.C、 Compilation fails because of an error in line 9.D、 If you define D e = new E(), then e.bMethod() invokes the version of bMethod()defined in Line 5.E、 If you define D e = (D)(new E()),then e.bMethod() invokes the version of bMethod() defined in Line 5.F、 If you define D e = (D)(new E()), then e.bMethod() invokes the version of bMethod() defined in Line 9.
查看答案
问题: 现有: 1. interface Altitude { 2. //insert code here 3. } 和4个声明: int HIGH = 7; public int HIGH = 7; abstract int HIGH = 7; interface int HIGH = 7; 分别插入到第2行,有多少行可以编译?() A、 0B、 1C、 2D、 3E、 4
问题:You want a class to have access to members of another class in the same package. Which is the most restrictive access modifier that will accomplish that will accomplish this objective?()A、 PublicB、 PrivateC、 ProtectedD、 TransientE、 No access modifier is required.
问题: 现有: class Banana2 f static int X=2; public static void main (String [] args) { int X=2; Banana2 b=new Banana2(); b.go(x); } static {x+=x; } void go (int x) { ++x; System. out.println (x); } 结果为:() A、7B、5C、3D、2
问题:在linux系统中,有一个文件夹里面有若干文件,通常用哪个命令可以获取这个文件夹的大小()。A、ls –hB、du –shC、df –D、fdish -h
问题: public class Test { public static void main (String args) { string foo = “blue”; string bar = foo; foo = “green”; System.out.printIn(bar); } } What is the result?() A、 An exception is thrown.B、 The code will not compile.C、 The program prints “null”D、 The program prints “blue”E、 The program prints “green”
问题: 现有: class Output { public static void main (String[] args) { int i=5: System.out.print( "4"+i+""); System.out.print (i+5+"7"); System.out.println (i+"8"); } } 结果为:() A、 99722B、 955758C、 4510758D、 459722
问题:构造函数只能重载不能覆盖
问题: A UNIX user named Bob wants to replace his chess program with a new one, but he is hot sure where the old one is installed. Bob is currently able to run a Java chess program starting from his home directory /home/bob using the command: java -classpath /test:/home/bob/downloads/* .jar games.Chess Bob‟s CLASSPATH is set (at login time) to: /usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/* .jar What is a possible location for the Chess.class file?() A、 /test/Chess.classB、 /home/bob/Chess.classC、 /test/games/Chess.classD、 /usr/lib/games/Chess.classE、 /home/bob/games/Chess.classF、 inside jarfile /opt/java/lib/Games.jar (with a correct manifest)G、 inside jarfile /home/bob/downloads/Games.jar (with a correct manifest)
问题:程序员已经创建了一个类,该类的实例可以用做Hashtable 的键(key)。哪两项是对的?() A、该类有一个返回类型为 int 的 equals 方法。B、该类有一个返回类型为 boolean 的 equals 方法。C、该类有一个接收一个参数的 equals 方法。D、该类有一个接收两个参数的 equals 方法。
问题:类的静态成员与普通的对象成员之间有什么区别?()A、类的所有对象共享一个静态成员B、表态成员属于类,而普通成员属于对象C、静态成员变量可以被类或普通成员访问到,但它们访问的静态成员变量实际不相同D、静态成员函数只能访问静态成员变量,不能访问普通成员变量E、静态成员变量就是值不会再变的成员变量
问题: public class Employee{ private String name; public Employee(String name){ this.name = name; } public void display(){ System.out.print(name); } } public class Manager extends Employee{ private String department; public Manager(String name,String department){ super(name); this.department = department; } public void display(){ System.out.println( super.display()+”,”+department); } } 执行语句new Manager(“smith”,”SALES”)后程序的输出是哪项?() A、 smith,SALESB、 null,SALESC、 smith,nullD、 null,null
问题:类的可访问性不影响类成员的可访问性
问题:下列哪个组件会产生Action事件?() A、ButtonsB、LabelsC、Check BoxesD、Windows
问题:Given a JSP error page, which implicit object refers to the uncaught Throwable that resulted in th epage being invoked?()A、 ErrorB、 ExceptionC、 ThrowableD、 Request errorE、 Request exception
问题:Java语言中表达式“11”+22的结果是哪项?() A、33B、1122C、22D、表达式错误
问题:Which two are characteristics of the Service Locator pattern?()A、It encapsulates component lookup procedures.B、It increases source code duplication and decreases reuse.C、It improves client performance by caching context and factory objects.D、It degrades network performance due to increased access to distributed lookup services.
问题: public class Plant { private String name; public Plant(String name) { this.name = name; } public String getName() { return name; } } public class Tree extends Plant { public void growFruit() { } public void dropLeaves() { } } Which is true?() A、 The code will compile without changes.B、 The code will compile if public Tree() { Plant(); } is added to the Tree class.C、 The code will compile if public Plant() { Tree(); } is added to the Plant class.D、 The code will compile if public Plant() { this(”fern”); } is added to the Plant class.E、 The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.
问题: You are assigned the task of building a panel containing a TextArea at the top, a label directly below it,and a button directly below the label. If the three components are added directly to the panel. Which layout manager can the panel use to ensure that the TextArea absorbs all of the free vertical space when the panel is resized?()A、 GridLayout.B、 CardLayout.C、 FlowLayout.D、 BorderLayout.E、 GridBagLayout.
问题:Which two can be used to create a new Thread? ()A、 Extend java.lang.Thread and override the run method.B、 Extend java.lang.Runnable and override the start method.C、 Implement java.lang.thread and implement the run method.D、 Implement java.lang.Runnable and implement the run method.E、 Implement java.lang.Thread and implement the start method.