Ch. 10

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

T/F: A class can implement only one interface.

False

T/F: A superclass has a member with package access. A class that is outside the superclass's package but inherits from the superclass can access the member.

False

T/F: An object of a superclass can access members declared in a subclass.

False

T/F: If a subclass constructor does not explicitly call a superclass constructor, Java will not call any of the superclass's constructors.

False

T/F: When a method is declared with the final modifier, it must be overridden in a subclass.

False

T/F: a subclass reference variable can reference an object of the superclass

False

All classes directly or indirectly inherit from this class.

Object

These superclass members are accessible to subclasses and classes in the package.

Protected

In a subclass constructor, a call to the superclass constructor must

appear as the very first statement

This key word refers to an object's superclass.

base

Abstract classes cannot

be instantiated

Fields in an interface are

both final and static

With this type of binding, the Java Virtual Machine determines at runtime which method to call, depending on the type of the object that a variable references.

dynamic

This key word indicates that a class inherits from another class.

extends

this key word indicates that a class inherits from another class

extends

An anonymous inner class must

implement an interface extend a superclass

You can use a lambda expression to instantiate an object that

implements a functional interface

This operator can be used to determine whether a reference variable references an object of a particular class.

instanceof

You use the ____ operator to define an anonymous inner class.

new

A functional interface is an interface with

only one abstract method

A method in a subclass having the same name as a method in the superclass but a different signature, is an example of

overloading

Abstract methods must be

overridden

A method in a subclass having the same signature as a method in the superclass is an example of

overriding

When a class implements an interface, it must

provide all of the nondefault methods that are listed in the interface, with the exact signatures and return types specified

In an inheritance relationship, this is the specialized class.

subclass

The following is an explicit call to the superclass's default constructor.

super();

In an inheritance relationship, this is the general class.

superclass

T/F: Constructors are not inherited.

True

T/F: In a subclass, a call to the superclass constructor can only be written in the subclass constructor

True

T/F: The superclass constructor always executes before the subclass constructor.

True

T/F: When a class contains an abstract method, the class cannot be instantiated.

True

T/F: a superclass reference variable can reference an object of a subclass that extends the superclass

True

T/F: by default all members of an interface are public.

True


Set pelajaran terkait

Lesson 2: Justification, Assessment, and Implementation of Energized Work

View Set

Income Approach to Valuation + WACC

View Set

Psychology Chapter 3: Biopsychology Quiz

View Set