Java Chapter 9

Ace your homework & exams now with Quizwiz!

In the following statement, which is the superclass? public class ClassA extends ClassB implements ClassC

ClassB

In the following statement, which is the interface? public class ClassA extends ClassB implements ClassC

ClassC

In ________, inheritance is shown with a line that has an open arrowhead at one end that points to the superclass.

UML diagrams

If ClassC is derived from ClassB, which is derived from ClassA, this would be an example of

a chain of inheritance

In a UML diagram, you show a realization relationship by connecting a class and an interface with a

dashed line that has an open arrowhead at one end

Protected class members can be denoted in a UML diagram with the ________ symbol.

#

If a method in a subclass has the same signature as a method in the superclass, the subclass method overrides the superclass method.

false

In an inheritance relationship, the subclass constructor always executes before the superclass constructor.

false

You show inheritance in a UML diagram by connecting two classes with a line that has an open arrowhead that points to the subclass.

false

In object-oriented programming, ________ allows you to extend the capabilities of a class by creating another class that is a specialized version of it.

inheritance

You can use this operator to determine whether an object is an instance of a particular class.

instanceOf

An abstract class is not instantiated itself, but serves as a superclass for other classes.

true

When an "is a" relationship exists between objects, it means that the specialized object has all of the characteristics of the general object, plus additional characteristics that make it special.

true

When a class does not use the extends key word to inherit from another class, Java automatically extends it from the ________ class.

Object

A class becomes abstract when you place the ________ key word in the class definition.

abstract

If you do not provide an access specifier for a class member, the class member is given ________ access by default.

package

In Java, a reference variable is ________ because it can reference objects of types different from its own, as long as those types are related to its type through inheritance.

polymorphic

Because the subclass is more specialized than the superclass, it is sometimes necessary for the subclass to replace inadequate superclass methods with more suitable ones.

true

When a class contains an abstract method, you cannot create an instance of the class.

true

You can write a super statement that calls a superclass constructor, but only in the subclass's constructor.

true


Related study sets

CH 57 Drugs for Attention Deficit Hyperactivity and Narcolepsy

View Set

J'adore les maths et le français!

View Set

Chapter 09 - Stocks - Section 1 - Common Stocks and Preferred Stocks

View Set

Chapter 9: Marketing with LinkedIn

View Set

Unit 25 - (Ch. 113-114) Thermodynamics & Refrigerants

View Set

Hubspot Email Marketing Certification

View Set