Exam 11: Advanced Inheritance Concepts

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

How is the Object class equals() method implemented?

(Essay)
4.8/5
(39)

Which of the following is NOT true regarding abstract methods?

(Multiple Choice)
4.9/5
(34)

The  Object  class  equals() method returns a boolean value indicating whether the objects are equal. This  equals() method considers two objects to be equal only if they have the same ____.

(Multiple Choice)
4.7/5
(42)

What is an abstract class? Give an example and explain how it works.

(Essay)
4.8/5
(38)

The ____ method is useful in debugging a program because it can be used to display and examine values.

(Multiple Choice)
4.9/5
(33)

It is common to create an interface when you want a class to implement behavior from more than one parent.

(True/False)
4.9/5
(45)

Give an example of how you can create an interface to have a class implement behavior from more than one parent.

(Essay)
4.8/5
(46)

If you attempt to instantiate an object from an abstract class, you receive an error message from the compiler that you have committed a(n) ____.

(Multiple Choice)
4.8/5
(35)
Match each term with the correct statement below.
Premises:
An alternative to multiple inheritance available in Java
Responses:
hash code
interface
functional interface
Correct Answer:
Verified
Premises:
Responses:
An alternative to multiple inheritance available in Java
hash code
(Matching)
4.9/5
(35)

public abstract class Shape {     private int length;     private int width;     private int height;     ----Code here---- } Using the above code, create the statement in the place indicated that will create an abstract calculateArea() method in the abstract Shape class.

(Essay)
4.9/5
(31)
Match each term with the correct statement below.
Premises:
A method that is inherited
Responses:
concrete class
java.lang
virtual classes
Correct Answer:
Verified
Premises:
Responses:
A method that is inherited
concrete class
(Matching)
4.7/5
(32)

When you create a number of classes that inherit from each other, as well as multiple interfaces that you want to implement with these classes, you often will find it convenient to place these related classes in a(n) ____.

(Multiple Choice)
4.7/5
(39)
Match each term with the correct statement below.
Premises:
A class-naming conflict
Responses:
multiple inheritance
lambda expression
anonymous inner class
Correct Answer:
Verified
Premises:
Responses:
A class-naming conflict
multiple inheritance
(Matching)
4.8/5
(39)

    The code above provides an example of an interface class. Explain the purpose and advantages of creating interfaces that store related constants.     The code above provides an example of an interface class. Explain the purpose and advantages of creating interfaces that store related constants. The code above provides an example of an interface class. Explain the purpose and advantages of creating interfaces that store related constants.

(Essay)
4.9/5
(38)

Describe the two method types programmers of an abstract class can include.

(Essay)
4.9/5
(46)
Match each term with the correct statement below.
Premises:
Has no name and is defined inside another class
Responses:
equals() method
public , static , and final
virtual classes
Correct Answer:
Verified
Premises:
Responses:
Has no name and is defined inside another class
equals() method
(Matching)
4.9/5
(42)

  The AnimalReference application shown above contains a generic Animal reference variable into which you can assign concrete Animal objects. Explain how this example uses polymorphism and why it is important. The AnimalReference application shown above contains a generic Animal reference variable into which you can assign concrete Animal objects. Explain how this example uses polymorphism and why it is important.

(Essay)
4.8/5
(47)

An application's ability to select the correct subclass method is known as ____.

(Multiple Choice)
4.8/5
(40)

The Object class equals() method returns a(n) ____ value indicating whether the objects are equal.

(Multiple Choice)
4.8/5
(41)

Classes from which objects can be instantiated are called constant classes.

(True/False)
4.9/5
(42)
Showing 41 - 60 of 78
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)