单项选择题
Given:
Which code, inserted at line 15, allows the class Sprite to compile?()
A.Foo { public int bar() { return 1; }
B.new Foo { public int bar() { return 1; }
C.new Foo() { public int bar() { return 1; }
D.new class Foo { public int bar() { return 1; }
相关考题
-
单项选择题
Click the Exhibit button. Given: ClassA a = new ClassA();a.methodA(); What is the result?()
A.Compilation fails.
B.ClassC is displayed.
C.The code runs with no output.
D.An exception is thrown at runtime. -
多项选择题
Given: 35.String #name = "Jane Doe"; 36.int $age = 24; 37.Double _height = 123.5; 38.double ~temp = 37.5; Which two statements are true?()
A.Line 35 will not compile.
B.Line 36 will not compile.
C.Line 37 will not compile.
D.Line 38 will not compile. -
单项选择题
Given: What is the result?()
A.An exception is thrown at runtime.
B.Compilation fails because of an error in line 7.
C.Compilation fails because of an error in line 4.
D.Compilation succeeds and no runtime errors with class A occur.
