Exam 11: Advanced Inheritance Concepts

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

What is the toString() method used for and how is it used?

Free
(Essay)
4.8/5
(37)
Correct Answer:
Verified

The Object class toString() method converts an Object into a String that contains information about the Object . If you do not create a toString() method that overrides the version in the Object class, you can use the superclass version of the method.

A(n) ____ is not an object, but it points to a memory address.

Free
(Multiple Choice)
4.8/5
(35)
Correct Answer:
Verified

B

In other programming languages, such as C++, abstract classes are known as ____ classes.

Free
(Multiple Choice)
4.8/5
(40)
Correct Answer:
Verified

D

Which of the following statements creates an array of three Animal references?

(Multiple Choice)
4.7/5
(29)

When you create a superclass and one or more subclasses, each object of each subclass is a subclass object.

(True/False)
4.9/5
(36)
Match each term with the correct statement below.
Premises:
Prohibited in Java
Responses:
JAR file
anonymous inner class
dynamic method binding
Correct Answer:
Verified
Premises:
Responses:
Prohibited in Java
JAR file
(Matching)
4.8/5
(35)

A class that will be placed in a nondefault package for others to use must be private .

(True/False)
4.9/5
(29)

When a class both extends and implements , by convention the ____ clause follows the keyword  extends  in the class header.

(Multiple Choice)
4.8/5
(39)

If you create an empty method within an abstract class, the method is abstract even if you do not explicitly use the keyword abstract.

(True/False)
4.8/5
(34)

When you create a new subclass in Java, neither the superclass source code nor the superclass ____ is changed.

(Multiple Choice)
4.8/5
(32)
Match each term with the correct statement below.
Premises:
The name given to abstract classes in other programming languages, such as C++
Responses:
hash code
lambda expression
virtual classes
Correct Answer:
Verified
Premises:
Responses:
The name given to abstract classes in other programming languages, such as C++
hash code
(Matching)
4.8/5
(33)

A(n) ____ class is a class that you create only to extend from.

(Multiple Choice)
4.8/5
(47)

In the Java programming language, a package or class library is often delivered to users as a(n) ____ file.

(Multiple Choice)
5.0/5
(32)

When you show abstract classes and methods in class diagrams, their names appear in ____.

(Multiple Choice)
4.8/5
(30)

When you create a class and use the implements clause to implement an interface but fail to code one of the interface's methods, the compiler error generated indicates that you must declare your class to be ____.

(Multiple Choice)
4.8/5
(35)

If you do not specify a package for a class, it is placed in an unnamed ____ package.

(Multiple Choice)
4.8/5
(41)

____ is a calculated number that is used to uniquely identify an object.

(Multiple Choice)
4.9/5
(34)

  The shaded header of the talkingAnimal() method accepts any type of Animal argument. Explain how this is possible. The shaded header of the talkingAnimal() method accepts any type of Animal argument. Explain how this is possible.

(Essay)
4.9/5
(32)
Match each term with the correct statement below.
Premises:
Allows object instantiation
Responses:
lambda expression
nonabstract method
concrete class
Correct Answer:
Verified
Premises:
Responses:
Allows object instantiation
lambda expression
(Matching)
4.7/5
(41)
Match each term with the correct statement below.
Premises:
Considers two objects of the same class to be equal only if they have the same hash code
Responses:
java.lang
virtual classes
dynamic method binding
Correct Answer:
Verified
Premises:
Responses:
Considers two objects of the same class to be equal only if they have the same hash code
java.lang
(Matching)
4.9/5
(37)
Showing 1 - 20 of 78
close modal

Filters

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