Exam 10: Inheritance
Exam 1: Introduction to Computers and Java53 Questions
Exam 2: Java Fundamentals52 Questions
Exam 3: Decision Structures58 Questions
Exam 4: Loops and Files56 Questions
Exam 5: Methods56 Questions
Exam 6: A First Look at Classes58 Questions
Exam 7: Arrays and the Arraylist Class63 Questions
Exam 8: A Second Look at Classes and Objects52 Questions
Exam 9: Text Processing and More About Wrapper Classes62 Questions
Exam 10: Inheritance64 Questions
Exam 11: Exceptions and Advanced File Io59 Questions
Exam 12: Java-Fx: Gui Programming and Basic Controls42 Questions
Exam 13: Java-Fx: Advanced Controls40 Questions
Exam 14: Java-Fx: Graphics, Effects, and Media40 Questions
Exam 15: Recursion23 Questions
Exam 16: Databases40 Questions
Select questions type
If a method in a subclass has the same signature as a method in the superclass, the subclass method overrides the superclass method.
(True/False)
4.7/5
(41)
A __________ member's access is somewhere between public and private.
(Multiple Choice)
4.8/5
(35)
When a subclass overrides a superclass method, only the subclass's version of the method can be called with a subclass object.
(True/False)
4.8/5
(40)
In the following code, which line in ClassA has an error? Line 1 public interface MyInterface
Line 2 {
Line 3 int FIELDA = 55;
Line 4 public int methodA(double);
Line 5 }
Line 6 public class ClassA implements MyInterface
Line 7 {
Line 8 FIELDA = 60;
Line 9 public int methodA(double) { }
Line 10 }
(Multiple Choice)
4.8/5
(34)
In the following code, what is missing from ClassA? Line 1 public interface MyInterface
Line 2 {
Line 3 int FIELDA = 55;
Line 4 public int methodA(double);
Line 5 }
Line 6 public class ClassA implements MyInterface
Line 7 {
Line 8 FIELDA = 60;
Line 9 public int methodB(double) { }
Line 10 }
(Multiple Choice)
4.9/5
(33)
An abstract class is not instantiated itself but serves as a superclass for other classes.
(True/False)
4.9/5
(39)
In the following statement, which is the superclass? public class ClassA extends ClassB implements ClassC
(Multiple Choice)
4.8/5
(32)
Which of the following shows the inheritance relationships among classes in a manner similar to that of a family tree?
(Multiple Choice)
4.8/5
(35)
Protected class members can be denoted in a UML diagram with the __________ symbol.
(Multiple Choice)
4.9/5
(38)
__________ tells the Java compiler that a method is meant to override a method in the superclass.
(Multiple Choice)
4.7/5
(40)
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.8/5
(39)
If a method in a subclass has the same signature as a method in the superclass, the subclass method __________ the superclass method.
(Multiple Choice)
4.9/5
(40)
The __________ key word is used to call a superclass constructor explicitly.
(Multiple Choice)
4.7/5
(38)
When declaring class data members it is best to declare them as __________.
(Multiple Choice)
5.0/5
(37)
What is wrong with the following code? public class ClassB extends ClassA
{
Public ClassB()
{
Int init = 10;
Super(40);
}
}
(Multiple Choice)
4.9/5
(40)
It is not possible for a superclass to call a subclass's method.
(True/False)
4.9/5
(36)
Showing 41 - 60 of 64
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)