Starting out with Java - Chapter 10

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

This key word refers to an object's superclass. A. super B. base C. superclass D. this

A. super

A method in a subclass that has the same signature as a method in the superclass is an example of \. A. overloading B. overriding C. composition D. an error

B. overriding

A subclass does not have access to these superclass members. A. public B. private C. protected D. all of these

B. private

When a class implements an interface, it must \. A. overload all of the methods listed in the interface B. provide all of the nondefault methods that are listed in the interface, with the exact signatures and return types specified C. not have a constructor D. be an abstract class

B. 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 general class. A. subclass B. superclass C. follower class D. child class

B. superclass

Abstract classes cannot . A. be used as superclasses B. have abstract methods C. be instantiated D. have fields

C. be instantiated

Fields in an interface are \. A. final B. static C. both final and static D. not allowed

C. both final and static

You can use a lambda expression to instantiate an object that . A. that has no constructor. B. extends any superclass. C. implements a functional interface D. does not implement an interface.

C. implements a functional interface

This operator can be used to determine whether a reference variable references an object of a particular class. A. isclass B. typeof C. instanceof D. isinstance

C. instanceof

You use the operator____ to define an anonymous inner class. A. class B. inner C. new D. anonymous

C. new

These superclass members are accessible to subclasses and classes in the same package. A. private B. public C. protected D. all of these

C. protected

In an inheritance relationship, this is the specialized class. A. superclass B. leader class C. subclass D. parent class

C. subclass

The following is an explicit call to the superclass's default constructor. A. default(); B. class(); C. super(); D. base();

C. super();

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. A. static B. early C. flexible D. dynamic

D. dynamic

An anonymous inner class must . A. be a superclass B. implement an interface C. extend a superclass D. either b or c.

D. either b or c.

This key word indicates that a class inherits from another class. A. derived B. specialized C. based D. extends

D. extends

TRUE OR FALSE: A class may only implement one interface.

False

TRUE OR FALSE: A subclass reference variable can reference an object of the superclass.

False

TRUE OR FALSE: An object of a superclass can access members declared in a subclass.

False

TRUE OR FALSE: Constructors are not inherited.

False

TRUE OR FALSE: If a subclass constructor does not explicitly call a superclass constructor, Java will not call any of the superclass's constructors.

False

TRUE OR FALSE: When a method is declared with the final modifier, it must be overridden in a subclass.

False

All classes directly or indirectly inherit from this class. A. Object B. Super C. Root D. Java

A. Object

In a subclass constructor, a call to the superclass constructor must \. A. appear as the very first statement B. appear as the very last statement C. appear between the constructor's header and the opening brace D. not appear

A. appear as the very firs statement

A functional interface is an interface with . A. only one abstract method. B. no abstract methods. C. only private methods. D. no name.

A. 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 \. A. overloading B. overriding C. composition D. an error

A. overloading

Abstract methods must be \. A. overridden B. overloaded C. deleted and replaced with real methods D. declared as private

A. overridden

TRUE OR FALSE: 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.

True

TRUE OR FALSE: A superclass reference variable can reference an object of a subclass that extends the superclass.

True

TRUE OR FALSE: By default all members of an interface are public.

True

TRUE OR FALSE: In a subclass, a call to the superclass constructor can only be written in the subclass constructor.

True

TRUE OR FALSE: The superclass constructor always executes before the subclass constructor.

True

TRUE OR FALSE: When a class contains an abstract method, the class cannot be instantiated.

True


संबंधित स्टडी सेट्स

Ch. 15 Clinical Psychology Multiple Choice

View Set

Evolve: Endo, Endocrine NCLEX, Endocrine Disorder chapter 50 NCLEX Questions, Endocrine NCLEX Practice Questions, Chapter 63 Care of Patients with Problems of the Thyroid Parathyroid Glands, Endocrine NCLEX Questions, NCLEX practice: endocrine, Chapt...

View Set

(NUR 100) Prep U CH 40 fluid, electrolyte and acid-base balance

View Set

Pedestrian and emergency vehicles Drivers ed

View Set