Which one istrue ?
A. Print 2.
B. Print 4.
C. Print 8.
D. Compilation fails.
E. An exception is thrown at runtime.
176.
2. Given :
Whichtwo changes should be made to correct the compilation
errors.
A. Insert a super(); into the Child constructor.
B. Insert a super(n); into the Child constructor.
C. Insert a this(); into the Child constructor.
D. Remove the public from all constructors.
E. Change private at line 2 to protected.
F. Change the name at line 2 to name = ""
4. Given:
What isthe result?
A. ... @!#
D. Compilation fails.
runtime.
F. ... ~~~
B. ~~~ @!#
C. ~~~ ~~~
E. An exception is thrown at
181.
5. Which threestatements concerning is-a and has-a
relationships are true? (Choose three)
A. Inheritance is is-a relationship.
B. Inheritance is has-a relationship.
C. Member variable can be used to implement the is-a
relationship.
D. Member variable can be used to implement the has-a
relationship.
E. Child class is-a parent class.
F. Parent class is-a child class.
G. Parent class has-a child class.
182.
6. Place theClasses in Type column and Relationships in
Relationship column, to match the is-a or has-a
relationships.
Which code insertedat line 8 will compile? (Choose all that
apply.)
A. private void print(String s) { }
B. protected void print(String s) { }
C. String print(String x) { }
D. String print(int i) { return "ok"; }
E. void print(String s, String t) { }
F. B print(String z) { }
G. B print(A a) { return (B)a; }
H. Object print(A a) { return a; }
187.
8. Given thefollowing code, place the correct Output Strings
to the Output Sequence:
190.
9. Given:
What isthe result?
A. ABC
D. BC
B. ABAC
E. CB
C. BACA
F. CABA
10. Drag anddrop the appropriate sentence into the following
empty boxes:
194.
Which code insertedat line 7 will compile?(Choose all that
apply.)
A. This() { this.i = 5; }
B. This() { super.i = 5; }
C. This() { super(5); }
D. This() { Super(5); }
E. This() { this(5); }
F. This() { This(5); }