Professional Documents
Culture Documents
Cs Quizlet. 1pdf
Cs Quizlet. 1pdf
with a call to
to super.act(); Which of the following describes correctly the use of that method call?
D
A. The call is required to properly instantiates the constructor of the superclass.
B. The call is required to properly initiate polymorphism in the umbrella superclass.
C. The call is required for any subclass methods that re-define the act method.
D. The call is not required, but is beneficial to handle execution common to all actors.
E. The call is not required, but is beneficial to understand the program flow of
polymorphism
// Assume that the Language is the superclass for classes English, German, Dutch and French.
countries.add(new Language());//2
countries.add(new English()); //3
countries.add(new German()); //4
countries.add(new Dutch()); //5
1-6
countries.add(new French()); //6
countries.add(new Language());//2
countries.add(new English()); //3
countries.add(new German()); //4
countries.add(new Dutch()); //5
7/8
countries.add(new French()); //6
The railCars array contains objects of different classes. The drawCar method of each
method is called.
Since there are different objects in the array, there are also different implementations of the
drawCar method available. How is the correct drawCar method called.
A. Each drawCar method that is different gets a different memory location when the
C
program is finished
B. At compile-time every version of the polymorphic method is connection to a memory
location.
C. At run-time every version of the polymorphic method is connected to a memory
location
D. With early binding when the bytecode file is created
inferface Language{(greet)}
A. The language interface is the umbrella for German and Dutch classes
E
B. The German and Dutch classes are con tained with composition in the Language class
C. The Language class is contained inside the German and Dutch classes with composition.
D. The Language class is the superclass for the German and Dutch implementing classes
E. Both A and D
inferface Language{(greet)}
A. The language interface is the umbrella for German and Dutch classes
A
B. The German and Dutch classes are con tained with composition in the Language class
C. The Language class is contained inside the German and Dutch classes with composition.
D. The Language class is the interface for the German and Dutch implementing classes
E. Both A and D
D
}
public static void printGreeting(Language obj)
{
obj.greeting();
}
Given only the provided program code with the two methods on this page, which of the following is false?
C
}
public static void printGreeting(Language obj)
{
obj.greeting();
}
Given only the provided program code with the two methods on this page, which of the following is true?