单项选择题
What will be the appearance of an applet with the following init() method?
public void init() {
add(new Button("hello")); }
A.Nothing appears in the applet.
B.A button will cover the whole area of the applet.
C.A button will appear in the top left corner of the applet.
D.A button will appear, centered in the top region of the applet.
E.A button will appear in the center of the applet.
相关考题
-
多项选择题
Whichmodifiersandreturntypeswouldbevalidinthedeclarationofaworkingmain()methodforaJavastandaloneapplication?()
A.private
B.final
C.static
D.int
E.abstract -
单项选择题
Whichstatementsconcerningtheswitchconstructaretrue?()
A.All switch statements must have a default label.
B.There must be exactly one label for each code segment in a switch statement.
C.The keyword continue can never occur within the body of a switch statement.
D.No case label may follow a default label within a single switch statement.
E.A character literal can be used as a value for a case label. -
单项选择题
What will be the result of attempting to compile and run the following code?() public class Q6b0c { public static void main(String args[]) { int i = 4; float f = 4.3; double d = 1.8; int c = 0; if (i == f) c++; if (((int) (f + d)) == ((int) f + (int) d)) c += 2; System.out.println(c); } }
A.The code will fail to compile.
B.0 will be written to the standard output.
C.1 will be written to the standard output.
D.2 will be written to the standard output.
E.3 will be written to the standard output.
