int x, b=0; for(x = 0; x <= 5; ++x){ if (x == 2) break; ++b; }
查看答案
给出以下程序:1. public class Electronic implements Device2.{ public void doIt() { } }3. abstract class Phone1 extends Electronic { }5. abstract class Phone2 extends Electronic6.{ public void doIt(int x) { } }7. class Phone3 extends Electronic implements Device8.{ public void doStuff() { } }9. interface Device { public void doIt(); }程序输出结果为?()
A. Compilation succeeds
B. Compilation fails with an error on line 1
Compilation fails with an error on line 3
D. Compilation fails with an error on line 5
给出下面的代码()class Person{String name,department;public void printValue(){System.out.println("name is"+name);}}public class Teacher extends Person{int salary;public void printValue(){_______________________System.out.println("salary is"+ salary);}}}下面的哪个表达式可以加入到Teacher类的printValue()方法中.
A. printValue();
B. this.printValue();
C. person.printValue();
D. super.printValue(D);
以下哪个事件表示按下java.awt.Component键?()
A. KeyEvent
B. KeyDownEvent
C. KeyPressEvent
D. KeyTypedEvent
E. KeyPressedEvent
Test类中合法的构造函数是()
A. test() { }
B. Test() { }
C. void Test() { }
D. private final Test() { }