单项选择题
What is the result?()
A.Compilation fails.
B.Cannot add Toppings
C.The code runs with no output.
D.A NullPointerException is thrown in Line 14.
相关考题
-
多项选择题
Which two code fragments represent these relationships?()
A.class Widget{Sprocket s;};class Gadget extends Widget{Spring s;}
B.class Widget{};class Gadget extends Widget{Spring s1; Sprocket s2;}
C.class Widget{Sprocket s1; Spring s2;};class Gadget extends Widget{}
D.class Gadget{Spring s;};class Widget extends Gadget{Sprocket s;}
E.class Gadget{};class Widget extends Gadget{Sprocket s1; Spring s2;}
F.class Gadget{Spring s1; Sprocket s2;};class Widget extends Gadget{} -
多项选择题
Which two code fragments, inserted independently at line 12, will compile?()
A.super(name, baseSalary);
B.this.commission=commission;
C.super();this.commission=commission;
D.this.commission = commission;super();
E.super(name, baseSalary);this.commission=commission;
F.this.commission=commission;super(name, baseSalary);
G.super(name, baseSalary, commission); -
单项选择题
What statement 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.
