Exam 10: Inheritance and Polymorphism
Exam 1: An Overview of Computers and Programming Languages50 Questions
Exam 2: Basic Elements of Java50 Questions
Exam 3: Introduction to Objects and Inputoutput50 Questions
Exam 4: Control Structures I: Selection50 Questions
Exam 5: Control Structures II: Repetition50 Questions
Exam 6: Graphical User Interface Gui and Object-Oriented Design OOD50 Questions
Exam 7: User-Defined Methods50 Questions
Exam 8: User-Defined Classes and Adts50 Questions
Exam 9: Arrays50 Questions
Exam 10: Inheritance and Polymorphism50 Questions
Exam 11: Handling Exceptions and Events50 Questions
Exam 12: Advanced Guis and Graphics49 Questions
Exam 13: Recursion50 Questions
Exam 14: Searching and Sorting50 Questions
Select questions type
In dynamic binding, the method that gets executed is determined at compile time, not at execution time.
(True/False)
4.7/5
(43)
-Based on the diagram in the accompanying figure, the method setDimension in the class Box ____ the method setDimension in the class Rectangle.

(Multiple Choice)
4.8/5
(32)
An interface is a class that contains only abstract methods and/or named constants.
(True/False)
4.9/5
(42)
Redefining a method of a superclass is also known as overloading a method.
(True/False)
4.7/5
(33)
Suppose that the class Mystery is derived from the class Secret. Consider the following statements. Secret secRef = new Secret(); Mystery mysRef = new Mystery(); Which of the following statements is legal in Java? (i) secRef = mysRef; (ii) mysRef = secRef;
(Multiple Choice)
4.8/5
(43)
Java uses late binding for methods that are private but not for methods that are marked final.
(True/False)
4.9/5
(41)
Which of the following statements about the reference super is true?
(Multiple Choice)
4.8/5
(41)
Consider the following class definitions. public class BClass {private int x; public void set(int a) { x = a; } public void print(){ }} public class DClass extends BClass {private int y; public void set(int a, int b) {//Postcondition: x = a; y = b;} public void print(){ }} Which of the following is the correct definition of the method set of the class DClass? (i) public void set(int a, int b) {super.set(a); y = b;} (ii) public void set(int a, int b) {x = a; y = b;}
(Multiple Choice)
4.9/5
(38)
Consider the following class definitions. public class BClass {private int x; private double y; public void print() { }} public class DClass extends BClass {private int a; private int b; public void print() { }} Suppose that you have the following statement. DClass dObject = new DClass(); How many instance variables does dObject have?
(Multiple Choice)
4.9/5
(43)
Which operator is used to determine if an object is of a particular class type?
(Multiple Choice)
4.8/5
(35)
Suppose there are three classes named Shape, Circle, and Square. What is the most likely relationship between them?
(Multiple Choice)
4.9/5
(36)
A polymorphic reference variable can refer to either an object of its own class or an object of the subclasses inherited from its class.
(True/False)
4.8/5
(43)
-Based on the diagram in the accompanying figure, the method area in the class Box ____ the method area in the class Rectangle.

(Multiple Choice)
4.7/5
(33)
A subclass cannot directly access public members of a superclass.
(True/False)
4.9/5
(37)
In Java, you can automatically make a reference variable of a subclass type point to an object of its superclass.
(True/False)
4.8/5
(25)
Showing 21 - 40 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)