• Home
  • Textbooks
  • Introduction to Programming with Java: A Problem Solving Approach
  • Inheritance and Polymorphism

Introduction to Programming with Java: A Problem Solving Approach

John S. Dean, Raymond H. Dean

Chapter 13

Inheritance and Polymorphism - all with Video Answers

Educators


Chapter Questions

02:00

Problem 1

If you want a class you define to inherit methods from the Object class, you must append the suffix, extends Object, to your class's heading. (T / F)

SS
Sarvesh Somasundaram
Numerade Educator
00:39

Problem 2

When used to compare reference variables, the $==$ operator works the same as the Object class's equals method. (T / F)

AG
Ankit Gupta
Numerade Educator
01:49

Problem 3

What does the equals method defined in the String class compare?

Adam Conner
Adam Conner
Numerade Educator
01:19

Problem 4

What is returned by the object class's tostring method?

Ernest Castorena
Ernest Castorena
Numerade Educator
01:19

Problem 5

What's wrong with replacing the println statement in Figure 13.2 's main method with these two statements?
String description $=$ car.tostring () ;
System .out.println (description);

Aditya Modi
Aditya Modi
Monroe Township High School
01:19

Problem 6

The return type of an overriding method must be the same as the return type of the overridden method. $(\mathrm{T} / \mathrm{F})$

Manik Pulyani
Manik Pulyani
Numerade Educator
01:19

Problem 7

In Java, polymorphic method calls are bound to method definitions at compile time (not runtime). (T / F)

SS
Sarvesh Somasundaram
Numerade Educator
02:00

Problem 8

Assume one reference variable's class is descended from another reference variable's class. To be able to assign one reference variable to the other one (without using a cast operator), the left-side variable's class must be a(n) ___________________________ of the right-side reference variable’s class.

SS
Sarvesh Somasundaram
Numerade Educator
00:41

Problem 9

A given array may contain elements of varying type. (T / $\mathrm{F}$ )

Destin Priester
Destin Priester
Numerade Educator
01:29

Problem 10

What are the syntax features of an abstract method?

Aditya Sood
Aditya Sood
Numerade Educator
00:57

Problem 11

Any class that contains an abstract method must be declared to be an abstract class. (T / F)

Aditya Sood
Aditya Sood
Numerade Educator
00:57

Problem 12

You cannot instantiate an abstract class. (T / F)

Aditya Sood
Aditya Sood
Numerade Educator
00:55

Problem 13

You can use an interface to provide direct access to a common set of constants from many different classes. $(\mathrm{T} / \mathrm{F})$

Aditya Sood
Aditya Sood
Numerade Educator
00:46

Problem 14

You can declare reference variables to have an interface type and use them just like you would use reference variables declared to be the type of a class in an inheritance hierarchy. (T / F)

Aditya Sood
Aditya Sood
Numerade Educator
00:46

Problem 15

Describe the access provided by the protected modifier.

Jennifer Stoner
Jennifer Stoner
Numerade Educator
01:19

Problem 16

It's illegal to use private for any method that overrides an abstract method. (T/F)

Manik Pulyani
Manik Pulyani
Numerade Educator