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
When you create a class by making it inherit from another class, you are provided with data fields and ____ automatically.
(Multiple Choice)
4.9/5
(37)
class InstanceofDemo
{
public static void main(String[] args)
{
Parent object1 = new Parent();
Parent object2 = new Child();
System.out.println("object1 instanceof Parent: "
+ (obj1 instanceof Parent));
System.out.println("object1 instanceof Child: "
+ (obj1 instanceof Child));
System.out.println("object1 instanceof MyInterface: "
+ (obj1 instanceof MyInterface));
System.out.println("object2 instanceof Parent: "
+ (obj2 instanceof Parent));
System.out.println("object2 instanceof Child: "
+ (obj2 instanceof Child));
System.out.println("object2 instanceof MyInterface: "
+ (obj2 instanceof MyInterface));
}
}
The above code defines a parent class (named Parent), a simple interface (named MyInterface), and a child class (named Child) that inherits from the parent and implements the interface.
Following program execution, what will be the output of the six println statements?
(Essay)
4.9/5
(33)
Using a class named Student, write the statement to create a yearOne object of the Student class.
(Essay)
4.8/5
(33)
The methods in a subclass can use all of the data fields and methods that belong to its parent, with one exception: ____ members of the parent class are not accessible within a child class's methods.
(Multiple Choice)
4.8/5
(31)
Conventionally, arrows used in a ____ to show inheritance relationships extend from the descendant class and point to the one from which it descends.
(Multiple Choice)
4.8/5
(30)
____ is the principle that allows you to apply your knowledge of a general category to more specific objects.
(Multiple Choice)
4.9/5
(34)
A class diagram consists of a rectangle divided into three sections.
(True/False)
5.0/5
(43)
If jrStudent is an object of Student, which of the following statements will result in a value of true?
(Multiple Choice)
4.7/5
(40)
Which statement correctly declares a sedan object of the Car class?
(Multiple Choice)
4.7/5
(46)
The ability to use inheritance in Java makes programs easier to write, ____, and more quickly understood.
(Multiple Choice)
4.7/5
(32)
Within a subclass, you can think of the keyword ____ as the opposite of super.
(Multiple Choice)
4.9/5
(34)
You would like to make a member of a class visible in all subclasses regardless of what package they are in. Which one of the following keywords would achieve this?
(Multiple Choice)
5.0/5
(36)
In most Java classes, the keyword private precedes each data field, and the keyword ____________________ precedes each method.
(Short Answer)
4.8/5
(43)
You can use the ____ modifier with methods when you don't want the method to be overridden.
(Multiple Choice)
4.9/5
(37)
Match each term with the correct statement below.
-Makes a program run faster
(Multiple Choice)
4.9/5
(36)
Showing 41 - 60 of 70
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)