Question: Java question: The following statements are to be used for questions 28 and 29 Suppose a class Car and its subclass Honda both have a
The following statements are to be used for questions 28 and 29 Suppose a class Car and its subclass Honda both have a method called speed as part of their class declarations The following statements are found in a method of the class Honda speed O super.speedO What will the first statement in the situation described above do? a. The speed method in class Honda will be called b. The speed method in class Car will be called c. Because no reference variable is used to call method speed a compile-time error would 28. be generated Overloading will be used to determine which speed method to use. d. 29. What does the second statement in the description above do? a. b. c. d. The speed method in class Honda will be called. The speed method in class Car will be called. The static method speed in the class RaceCar will be called. Overloading will be used to determine which method of speed to use. 30. When a subclass constructor calls its superclass constructor, what happens if the superclass's constructor does not assign a value to an instance variable? a. A syntax error occurs. b. A run-time error occurs. C. A compile-time error occurs. d. The program compiles and runs correctly because instance variables are always nitialized in Java. 31. Polymorphism enables the programmer to: program in the general. program in the specific. b. c. absorb attributes and behavior from previous classes. d. hide information from the user 32. A(n) class cannot be instantiated. final concrete c. abstract d. polymorphic a. b. What kind of object must be created to write a serialized object to a binary file? b. 33. OutputStream FileStream c. ObjectOutputStream d. Scanner 34. Declaring a method final means: a. b. C. d. it will prepare the object for garbage collection. it cannot be accessed from outside its class. It cannot be overloaded. it cannot be overridden. 35. Interfaces can have a, abstract methods. c. 2 0 any number of
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
