Exam 10: Inheritance
Exam 1: Introduction to Computers and Java51 Questions
Exam 2: Java Fundamentals61 Questions
Exam 3: Decision Structures64 Questions
Exam 4: Loops and Files57 Questions
Exam 5: Methods60 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class64 Questions
Exam 8: A Second Look at Classes and Objects50 Questions
Exam 9: Text Processing and More About Wrapper Classes60 Questions
Exam 10: Inheritance70 Questions
Exam 11: Exceptions and Advanced File IO56 Questions
Exam 12: A First Look at GUI Applications60 Questions
Exam 13: Advanced GUI Applications58 Questions
Exam 14: Applets and More54 Questions
Exam 15: Creating GUI Applications With Javafx and Scene Builder40 Questions
Exam 16: Recursion42 Questions
Exam 17: Databases48 Questions
Select questions type
When one object is a specialized version of another object, there is this type of relationship between them.
Free
(Multiple Choice)
4.9/5
(43)
Correct Answer:
B
It is not possible for a superclass to call a subclass's method.
Free
(True/False)
4.8/5
(42)
Correct Answer:
True
In the following code, what will the call to super do?
Public class ClassB extends ClassA
{
Public ClassB()
{
Super(40);
System.out.println("This is the last statement "+
"in the constructor.");
}
}
(Multiple Choice)
4.8/5
(44)
Private members of the superclass cannot be accessed by the subclass.
(True/False)
4.8/5
(30)
If two methods in the same class have the same name but different signatures, the second overrides the first.
(True/False)
4.8/5
(42)
Replacing inadequate superclass methods with more suitable subclass methods is known as what?
(Multiple Choice)
4.8/5
(32)
Protected class members are denoted in a UML diagram with the symbol
(Multiple Choice)
4.9/5
(42)
Every class is either directly or indirectly derived from the Object class.
(True/False)
4.9/5
(36)
This annotation tells the Java compiler that a method is meant to override a method in the superclass.
(Multiple Choice)
4.9/5
(35)
An abstract class is not instantiated, but serves as a superclass for other classes.
(True/False)
5.0/5
(30)
If a method in a subclass has the same signature as a method in the superclass, the subclass method overloads the superclass method.
(True/False)
4.8/5
(36)
A compiler error will result if an anonymous inner class tries to use a variable that is not final, or not effectively final.
(True/False)
4.9/5
(36)
Look at the following code. The method in line ________ will override the method in line ________. Line 1 public class ClassA
Line 2 {
Line 3 public ClassA() {}
Line 4 public int method1(int a){}
Line 5 public double method2(int b){}
Line 6 }
Line 7 public ClassB extends ClassA
Line 8 {
Line 9 public ClassB(){}
Line 10 public int method1(int b, int c){}
Line 11 public double method2(double c){}
Line 12 }
(Multiple Choice)
4.8/5
(44)
Look at the following code and determine what the call to super will do. public class ClassB extends ClassA
{
Public ClassB()
{
Super(10);
}
}
(Multiple Choice)
4.7/5
(39)
What is wrong with the following code?
Public class ClassB extends ClassA
{
Public ClassB()
{
Int init = 10;
Super(40);
}
}
(Multiple Choice)
4.7/5
(39)
Showing 1 - 20 of 70
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)