Java Ch9

23 Questions  I  By Bing22
Java ch9

  
Changes are done, please start the quiz.


Question Excerpt

Removing question excerpt is a premium feature

Upgrade and get a lot more done!
1.   Which of the following statements is false? 
A.
B.
C.
D.
2.   Inheritance is also known as the
A.
B.
C.
D.
3.   Which of the following is not a superclass/subclass relationship?
A.
B.
C.
D.
4.  : An advantage of inheritance is that:
A.
B.
C.
D.
5.  Which of the following keywords allows a subclass to access a superclass method even when the subclass has overridden the superclass method?
A.
B.
C.
D.
6.  Using the protected keyword gives a member:
A.
B.
C.
D.
7.  Superclass methods with this level of access cannot be called from subclasses.
A.
B.
C.
D.
8.   Every class in Java, except ________, extends an existing class.
A.
B.
C.
D.
9.  Overriding a method differs from overloading a method because:
A.
B.
C.
D.
10.  9.4.2 Q1: To avoid duplicating code, use ________, rather than ________.
A.
B.
C.
D.
11.  Consider the classes below, declared in the same file:class A {   int a;   public A()    {      a = 7;   }}class B extends A {   int b;   public B()    {b = 8;   }    }Which of the statements below is false?
A.
B.
C.
D.
12.  9.4.3 Q2: Which of the following is the superclass constructor call syntax?
A.
B.
C.
D.
13.  Which superclass members are inherited by all subclasses of that superclass?
A.
B.
C.
D.
14.  9.4.4 Q2: Which statement is true when a superclass has protected instance variables?
A.
B.
C.
D.
15.  9.4.5 Q1: private fields of a superclass can be accessed in a subclass
A.
B.
C.
D.
16.  Failure to prefix the superclass method name with the keyword super and a dot (.) separator when referencing the superclass’s method causes ________.
A.
B.
C.
D.
17.  9.5 Q1: When a subclass constructor calls its superclass constructor, what happens if the superclass’s constructor does not assign a value to an instance variable?
A.
B.
C.
D.
18.  9.6 Q1: Which of the following statements is (are) true?A.    We can use inheritance to customize existing software.B.    A superclass specifies commonality.C.    A superclass can be modified without modifying subclassesD.    A subclass can be modified without modifying its superclass.
A.
B.
C.
D.
19.  9.6 Q2: Which of the following is an example of a functionality that should not be “factored out” to a superclass?
A.
B.
C.
D.
20.  9.7 Q1: The default implementation of method clone of Object performs a ________.
A.
B.
C.
D.
21.  9.7 Q2: The default equals implementation determines:
A.
B.
C.
D.
22.  9.8 Q1: Class ________ represents an image that can be displayed on a JLabel.
A.
B.
C.
D.
23.  9.8 Q2: Which method changes the text the label displays?
A.
B.
C.
D.
Back to top


to post comments.

Removing ad is a premium feature

Upgrade and get a lot more done!
Take Another Quiz