Exam 9: Inheritance
Exam 1: Introduction98 Questions
Exam 2: Using Objects76 Questions
Exam 3: Implementing Classes103 Questions
Exam 4: Fundamental Data Types125 Questions
Exam 5: Decisions120 Questions
Exam 6: Loops128 Questions
Exam 7: Arrays and Array Lists118 Questions
Exam 8: Designing Classes95 Questions
Exam 9: Inheritance101 Questions
Exam 10: Interfaces85 Questions
Exam 11: Inputoutput and Exception Handling109 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion110 Questions
Exam 14: Sorting and Searching109 Questions
Exam 15: The Java Collections Framework110 Questions
Exam 16: Basic Data Structures104 Questions
Exam 17: Tree Structures110 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Graphical User Interfaces76 Questions
Exam 20: Streams and Binary Inputoutput82 Questions
Exam 21: Multithreading82 Questions
Exam 22: Internet Networking74 Questions
Exam 23: Relational Databases75 Questions
Exam 24: XML74 Questions
Exam 25: Web Applications75 Questions
Select questions type
Consider the following code snippet: Employee anEmployee = new Programmer();
String emp = anEmployee.toString();
Assume that the Programmer class inherits from the Employee class, and neither class has an implementation of the toString() method. Which of the following statements is correct?
(Multiple Choice)
4.9/5
(32)
Consider the hierarchy of classes shown below.
What is the superclass of the class TelevisionShow?

(Multiple Choice)
4.9/5
(43)
Consider the classes shown below: public class Parent
{
Private int value = 100;
Public int getValue()
{
Return value;
}
}
Public class Child extends Parent
{
Private int value;
Public Child(int number)
{
Value = number;
}
}
What is the output of the following lines of code?
Child kid = new Child(-14);
Parent kid2 = new Child(21);
System.out.println(kid.getValue() + " "
+ kid2.getValue());
(Multiple Choice)
4.8/5
(36)
Consider the following code snippet: public class Employee
{
) . .
Public void setEmployeeDept(String deptNum)
{
) . .
}
}
Public class Programmer extends Employee
{
) . .
Public void setEmployeeDept(int deptNum)
{
) . .
}
}
Which of the following statements is correct?
(Multiple Choice)
4.9/5
(42)
Consider the following code snippet: public void deposit(double amount)
{
TransactionCount ++;
Super.deposit(amount);
}
Which of the following statements is true?
(Multiple Choice)
4.9/5
(28)
If a subclass defines the same method name and the same parameter types for a method that appears in its superclass, ____.
(Multiple Choice)
4.8/5
(41)
Consider the following code snippet:
If(anObject instanceof Auto)
{
Auto anAuto = (Auto) anObject;
) . .
}
What does this code do?
(Multiple Choice)
4.9/5
(36)
Consider the hierarchy of classes shown below.
What is the superclass of the class ScriptedShow?

(Multiple Choice)
4.8/5
(31)
The ____ reserved word in a method definition ensures that subclasses cannot override this method.
(Multiple Choice)
4.8/5
(33)
Consider the following code snippet: public class Vehicle
{
) . .
Public void setVehicleClass(double numberAxles)
{
) . .
}
}
Public class Auto extends Vehicle
{
) . .
Public void setVehicleClass(int numberAxles)
{
) . .
}
}
Which of the following statements is correct?
(Multiple Choice)
4.9/5
(34)
Insert the missing code in the following code fragment. This fragment is intended to call the Vessel class's method. public class Vessel
{
) . .
Public void set VesselClass(double vesselLength)
{
) . .
}
}
Public class SpeedBoat extends Vessel
{
) . .
Public SpeedBoat()
{
_______________;
}
}
(Multiple Choice)
4.8/5
(43)
Consider the following code snippet that appears in a subclass: public void deposit(double amount)
{
TransactionCount ++;
Deposit(amount);
}
Which of the following statements is true?
(Multiple Choice)
4.7/5
(39)
Consider the following code snippet: Vehicle aVehicle = new Auto(4,"gasoline");
String s = aVehicle.toString();
Assume that the Auto class inherits from the Vehicle class, and neither class has an implementation of the toString() method. Which of the following statements is correct?
(Multiple Choice)
4.9/5
(37)
Consider the following code snippet:
Int vacationDays = 10;
String output = "Number of earned vacation days is " + vacationDays;
Which of the following statements is correct?
(Multiple Choice)
4.8/5
(37)
Consider the following code snippet: public class Score
{
Private String name;
) . .
Public boolean equals(Object otherScore)
{
Return name.equals(otherScore.name);
}
) . .
}
What is wrong with this code?
(Multiple Choice)
4.8/5
(36)
Which of the following statements about inheritance is correct?
(Multiple Choice)
4.8/5
(31)
If a class has an abstract method, which of the following statements is NOT true?
(Multiple Choice)
4.8/5
(43)
Showing 81 - 100 of 101
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)