swtich(expression)语句中表达式的类型可以是()A、StringB、charC、shortD、double
swtich(expression)语句中表达式的类型可以是()
- A、String
- B、char
- C、short
- D、double
相关考题:
假如我们想要对象eh来处理TextArea对象t的TextEvent事件,那么我们应如何把eh添加为t的事件处理程序?() A、 t.addTextListener (eh)B、 eh.addTextListener (t)C、 addTextListener (eh,t)D、 addTextListener (t, eh)
public class Mycircle { public double radius; public double diameter; public void setRadius(double radius) this.radius = radius; this.diameter= radius * 2; } public double getRadius() { return radius; } Which statement is true?() A、 The Mycircle class is fully encapsulated.B、 The diameter of a given MyCircle is guaranteed to be twice its radius.C、 Lines 6 and 7 should be in a synchronized block to ensure encapsulation.D、 The radius of a MyCircle object can be set without affecting its diameter.
class TestMain { static int x = 2; static { x = 4; } public static void main(String... args) { int y = x + 1; System.out.println(y); } } 和命令行: java TestMain 结果为:() A、 3B、 5C、 编译失败D、 运行时异常被抛出
interface foo { int k = 0; } public class test implements Foo ( public static void main(String args) ( int i; Test test = new test (); i= test.k; i= Test.k; i= Foo.k; ) ) What is the result? ()A、 Compilation succeeds.B、 An error at line 2 causes compilation to fail.C、 An error at line 9 causes compilation to fail.D、 An error at line 10 causes compilation to fail.E、 An error at line 11 causes compilation to fail.
Which will declare a method that forces a subclass to implement it?() A、 Public double methoda();B、 Static void methoda (double d1) {}C、 Public native double methoda();D、 Abstract public void methoda();E、 Protected void methoda (double d1){}