单项选择题

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.


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

What is the result?()

A.13
B.134
C.1234
D.2134
E.2143
F.4321

2.多项选择题

Which three methods, inserted individually at line 14, will correctly complete class Two?()

A.int foo(){/* more code here */}
B.void foo(){/* more code here */}
C.public void foo(){/* more code here */}
D.private void foo(){/* more code here */}
E.protected void foo(){/* more code here */}

3.多项选择题

Which three are true?()

A.Cat is-a Animal
B.Cat is-a Jumper
C.Dog is-a Animal
D.Dog is-a Jumper
E.Cat has-a Animal
F.Beagle has-a Tail
G.Beagle has-a Jumper

4.单项选择题

What is the result?()

A.420 is the output.
B.An exception is thrown at runtime.
C.All constructors must be declared public.
D.Constructors CANNOT use the private modifier.
E.Constructors CANNOT use the protected modifier.

6.单项选择题

What is the result?()

A.Compilation fails.
B.An exception is thrown at runtime.
C.doStuff x=6,main x=6
D.doStuff x=5,main x=5
E.doStuff x=5,main x=6
F.doStuff x=6,main x=5

7.单项选择题

What is the result?()

A.81
B.82
C.91
D.92
E.Compilation fails.
F.An exception is thrown at runtime.

9.单项选择题Which Man class properly represents the relationship "Man has a best friend who is a Dog"?()

A.class Man extends Dog{}
B.class Man implements Dog{}
C.class Man{private BestFriend dog;}
D.class Man{private Dog bestFriend;}
E.class Man{private Dog;}
F.class Man{private BestFriend;}

10.多项选择题

Which two, independently, will allow Sub to compile?()

A.Change line 2 to:public int a;
B.Change line 2 to:protected int a;
C.Change line 13 to:public Sub(){this(5);}
D.Change line 13 to:public Sub(){super(5);}
E.Change line 13 to:public Sub(){super(a);}