Exam 10: Introduction to Inheritance
Exam 1: Creating Java Programs68 Questions
Exam 2: Using Data74 Questions
Exam 3: Using Methods, Classes, and Objects68 Questions
Exam 4: More Object Concepts67 Questions
Exam 5: Making Decisions70 Questions
Exam 6: Looping72 Questions
Exam 7: Characters, Strings, and the Stringbuilder73 Questions
Exam 8: Arrays74 Questions
Exam 9: Advanced Array Concepts74 Questions
Exam 10: Introduction to Inheritance70 Questions
Exam 11: Advanced Inheritance Concepts70 Questions
Exam 12: Exception Handling65 Questions
Exam 13: File Input and Output74 Questions
Exam 14: Introduction to Swing Components74 Questions
Exam 15: Advanced Gui Topics69 Questions
Exam 16: Graphics74 Questions
Exam 17: Applets, Images, and Sound72 Questions
Select questions type
Usually, the subclass constructor only needs to initialize the ____ that are specific to the subclass.
(Multiple Choice)
4.9/5
(39)
The classes you create in ____________________ programming languages can inherit data and methods from existing classes.
(Short Answer)
4.9/5
(44)
When you employ ____, your data can be altered only by the methods you choose and only in ways that you can control.
(Multiple Choice)
4.8/5
(39)
If a programming language does not support ____, the language is not considered object-oriented.
(Multiple Choice)
4.7/5
(38)
Write the statement to create a class header with a superclass-subclass relationship, with Vehicle as the superclass and Subaru as the subclass.
(Short Answer)
4.9/5
(38)
Create a class named Employee with a name and a salary. Make a class named Manager that inherits from Employee with an instance field named department. Supply a toString() method that prints the manager's name, department, and salary. Make another class named Director that inherits from Manager with an instance field named stipendAmount. Supply the toString() method for Director that prints all of its instance variables. Also, write a program named myOutput that instantiates an object of each of the classes and invokes the toString() method of each of the objects.
(Essay)
4.9/5
(41)
If a ____ method has the same name as a parent class method and you use the name with a child class object, the child method hides the original.
(Multiple Choice)
4.9/5
(43)
Match each term with the correct statement below.
-Inherits from a base class
(Multiple Choice)
4.8/5
(33)
Which of the following statements depicts the valid format to call a superclass constructor from a subclass constructor?
(Multiple Choice)
4.7/5
(38)
When you create parent and child classes of your own, the child classes use ____ constructors.
(Multiple Choice)
4.9/5
(31)
Superclasses can be distinguished from their subclasses because a subclass is generally smaller than a superclass; it usually has fewer fields and methods.
(True/False)
4.9/5
(40)
In a UML diagram, minus signs are inserted in front of each private field or method, and plus signs are inserted in front of each public field or method.
(True/False)
4.7/5
(32)
Match each term with the correct statement below.
-Determines whether an object is a member or descendant of a class
(Multiple Choice)
4.7/5
(42)
Match each term with the correct statement below.
-A mechanism that enables one class to assume both the behavior and the attributes of another class
(Multiple Choice)
4.8/5
(34)
class Animal
{
void myDog()
{
System.out.println("Animal stuff");
}
}
class Dog extends Animal
{
void mydog()
{
System.out.println("Dog stuff");
}
public static void main(String args[])
{
Dog d = new Dog();
d.myDog();
super.myDog();
}
}
The above code gives a compiler error stating that the non-static variable super cannot be
referenced from a static context super.myDog();. Explain why the error occurs and describe what changes you could make for the code to be executable.
(Essay)
4.9/5
(31)
Sometimes the superclass data fields and methods are not entirely appropriate for the subclass objects; in these cases, you want to ____ the parent class members.
(Multiple Choice)
4.8/5
(44)
When you use the method name with a child object, the parent's version of the method is used.
(True/False)
4.9/5
(39)
By convention, a class diagram contains the ____ following each attribute or method.
(Multiple Choice)
4.9/5
(39)
Showing 21 - 40 of 70
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)