Exam 9: Inheritance
Exam 1: Introduction76 Questions
Exam 2: Using Objects82 Questions
Exam 3: Implementing Classes108 Questions
Exam 4: Fundamental Data Types124 Questions
Exam 5: Decisions119 Questions
Exam 6: Loops107 Questions
Exam 7: Arrays and Array Lists117 Questions
Exam 8: Designing Classes88 Questions
Exam 9: Inheritance99 Questions
Exam 10: Interfaces100 Questions
Exam 11: Input/Output and Exception Handling108 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion99 Questions
Exam 14: Sorting and Searching100 Questions
Exam 15: The Java Collections Framework102 Questions
Exam 16: Basic Data Structures102 Questions
Exam 17: Tree Structures102 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Stream Processing85 Questions
Exam 20: Graphical User Interfaces75 Questions
Exam 21: Advanced Input/Output90 Questions
Exam 22: Multithreading81 Questions
Exam 23: Internet Networking74 Questions
Exam 24: Relational Databases75 Questions
Exam 25: XML74 Questions
Select questions type
Consider the following code snippet:
Assume that the Auto class inherits from the Vehicle class, and both classes have an implementation of the moveForward method with the same set of parameters and the same return type.What determines which class's moveForward method is to be executed?

Free
(Multiple Choice)
4.9/5
(40)
Correct Answer:
A
Consider the following code snippet:
What does this code do?

Free
(Multiple Choice)
4.9/5
(36)
Correct Answer:
D
With a few exceptions, what access should instance variables of classes always have?
Free
(Multiple Choice)
4.9/5
(42)
Correct Answer:
B
Consider the following code snippet:
Assume that the Employee class has not implemented its own toString() method.What value will s contain when this code is executed?

(Multiple Choice)
4.9/5
(46)
Which of the following statements about inheritance is correct?
(Multiple Choice)
4.7/5
(33)
In Java, if you define two methods that have the same but different parameter types, the compiler will not complain. Why not?
(Multiple Choice)
4.9/5
(37)
Suppose the class Message is partially defined as shown below:
A subclass of Message, Excitedimessage, is defined that will behave like Message, except that it will add two exclamation points to the end of the message. Sample code that uses Excitedilessage is shown below:
Which ExcitedMessage constructor will give this behavior?


(Multiple Choice)
4.8/5
(29)
Consider the following code snippet that appears in a subclass:
Which of the following statements is true?

(Multiple Choice)
4.8/5
(37)
Consider the following code snippet:
If a Motorcycle class is created as a subclass of the Vehicle class, which of the following statements is correct?

(Multiple Choice)
4.7/5
(32)
Suppose the class Value is partially defined below
A subclass of Value, LargerValue, is defined with a getValue method that returns twice the value of the parent.Which line is the body of LargerValue's getValue method?

(Multiple Choice)
4.9/5
(37)
What is a class called that represents the most general entity in an inheritance hierarchy?
(Multiple Choice)
4.8/5
(28)
Which reserved word must be used to call a method of a superclass?
(Multiple Choice)
4.8/5
(27)
Consider the following code snippet:
What does this code do?

(Multiple Choice)
4.9/5
(34)
Consider the following code snippet:
Which of the following statements is correct?

(Multiple Choice)
4.8/5
(42)
Consider the hierarchy of classes shown below.
Which represent valid class headers that would be found in this hierarchy?

(Multiple Choice)
4.8/5
(34)
Consider the following inheritance hierarchy diagram:
Which of the following statements is correct?

(Multiple Choice)
4.8/5
(40)
Consider the following class hierarchy:
When an object of type Vehicle is constructed, what will be printed by the constructors from this inheritance hierarchy?

(Multiple Choice)
4.8/5
(33)
Showing 1 - 20 of 99
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)