Chapter 10 - Part 1

Ace your homework & exams now with Quizwiz!

________ tells the Java compiler that a method is meant to override a method in the superclass.

@Override

What is true about protected access?

Protected members may be accessed by methods in the same package or in a subclass, even when the subclass is in a different package.

When an "is a" relationship exists between objects, the specialized object has ________.

all of the characteristics of the general object plus additional characteristics

Which key word indicates that a class inherits from another class?

extends

What is the operator used to determine whether an object is an instance of a particular class?

instanceOf

What is an example of a lambda expression?

int x = x * factor;

________ is a special type of expression used to create an object that implements a functional interface.

lambda

If you don't provide an access specifier for a class member, the class member is given ________ access by default.

package

What statement correctly specifies two interfaces?

public class ClassA implements Interface1, Interface2

What statement declares Salaried as a subclass of PayType?

public class Salaried extends PayType

When declaring class data members it is best to declare them as ________.

private members

When a subclass overloads a superclass method ________.

both methods may be called with a subclass object

T/F: When a subclass overrides a superclass method, only the subclass's version of the method can be called with a subclass object.

True

T/F: You can write a super statement that calls a superclass constructor but only in the subclass's constructor.

True

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

a chain of inheritance

What shows the inheritance relationships among classes in a manner similar to that of a family tree?

class hierarchy


Related study sets

finance exam 1 definition question

View Set

Ch. 14 Weathering, Karst Landscapes, and Mass Movement

View Set

BCE - HB - Historical Books - Passages

View Set

Schema Theory (Bartlett 1932 Study)

View Set

Biol 328: Human Anatomy Quiz II Prep (From LGs)

View Set

Chapter 18: Public Choice, Taxes, and the Distribution of Income

View Set