Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Big Java Binder Early Objects
Quiz 9: Inheritance
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 61
Multiple Choice
Consider the following code snippet: public abstract class Employee { Public abstract void setSalary() ; ) . . } You wish to create a concrete subclass named Programmer. Which of the following is the correct way to declare this subclass?
Question 62
Multiple Choice
If a class has an abstract method, which of the following statements is NOT true?
Question 63
Multiple Choice
A class that cannot be instantiated is called a/an ____.
Question 64
Multiple Choice
Consider the Counter class below. public class Counter { Public int count = 0; Public int getCount() { Return count; } Public void increment() { Count++; } } Using the class above and the variables declared below, what is the value of num1.equals(num2) ? Counter num1 = new Counter() ; Counter num2 = new Counter() ;
Question 65
Multiple Choice
Consider the following code snippet: Vehicle aVehicle = new Auto() ; AVehicle.moveForward(200) ; Assume that the Auto class inherits from the Vehicle class, and both classes have an implementation of the moveForward method with the same set of parameters and the same return type. Which class's moveForward method is to be executed is determined by ____.
Question 66
Multiple Choice
Consider the following code snippet: Employee anEmployee = new Programmer() ; AnEmployee.increaseSalary(2500) ; Assume that the Programmer class inherits from the Employee class, and both classes have an implementation of the increaseSalary method with the same set of parameters and the same return type. Which class's increaseSalary method is to be executed is determined by ____.
Question 67
Multiple Choice
Consider the classes shown below: public class Parent { Public int getValue() { Return 24; } Public void display() { System.out.print(getValue() + " ") ; } } Public class Child extends Parent { Public int getValue() { Return -7; } } Using the classes above, what is the output of the following lines of code? Parent kid = new Child() ; Parent adult = new Parent() ; Kid) display() ; Adult.display() ;
Question 68
Multiple Choice
Suppose the abstract class Message is defined below public abstract class Message { Private String value; Public Message(String initial) { Value = initial; } Public String getMessage() { Return value; } Public abstract String translate() ; } A concrete subclass of Message, FrenchMessage, is defined. Which methods must FrenchMessage define?
Question 69
Multiple Choice
Consider the following code snippet: Vehicle aVehicle = new Auto() ; AVehicle.moveForward(200) ; Assume that the Auto class inherits from the Vehicle class, and both classes have an implementation of the moveForward method with the same set of parameters and the same return type. The process for determining which class's moveForward method to execute is called ____.
Question 70
Multiple Choice
Which of the following statements about classes is true?
Question 71
Multiple Choice
A class from which you cannot create objects is called a/an ____.
Question 72
Multiple Choice
Consider the following code snippet: Employee anEmployee = new Programmer() ; AnEmployee.increaseSalary(2500) ; If the Programmer class inherits from the Employee class, and both classes have an implementation of the increaseSalary method with the same set of parameters and the same return type, which statement is correct?
Question 73
Multiple Choice
Consider the classes shown below: public class Parent { Public int getValue() { Return 24; } Public void display() { System.out.print(getValue() + " ") ; } } Public class Child extends Parent { Public int getValue() { Return -7; } } Using the classes above, what is the output of the following lines of code? Child kid = new Child() ; Parent adult = new Parent() ; Kid) display() ; Adult.display() ;
Question 74
Multiple Choice
Consider the Counter class below. public class Counter { Public int count = 0; Public int getCount() { Return count; } Public void increment() { Count++; } } Using the class above and the variables declared below, what is the value of num1.equals(num2) ? Counter num1 = new Counter() ; Counter num2 = num1;
Question 75
Multiple Choice
Which of the following statements about classes is true?
Question 76
Multiple Choice
Consider the Counter class below. public class Counter { Public int count = 0; Public int getCount() { Return count; } Public void increment() { Count++; } } Using the class above and the variable declared below, what is the value of num.toString() ? Counter num = new Counter() ;
Question 77
Multiple Choice
Consider the following code snippet: Vehicle aVehicle = new Auto() ; AVehicle.moveForward(200) ; If the Auto class inherits from the Vehicle class, and both classes have an implementation of the moveForward method with the same set of parameters and the same return type, which statement is correct?
Question 78
Multiple Choice
Consider the following code snippet: public abstract class Machine { Public abstract void setRPMs() ; ) . . } You wish to create a concrete subclass named PolisherMachine. Which of the following is the correct way to declare this subclass?