This quiz titled 'java ch10' assesses understanding of polymorphism in Java, covering concepts like interfaces, superclass-subclass relationships, and abstract classes. It is designed for learners to evaluate their grasp on object-oriented programming principles, crucial for software development.
A. An interface describes a set of methods that can be called on an object, providing a default implementation for the methods.
B. An interface describes a set of methods that can be called on an object, not providing concrete implementation for the methods.
C. Interfaces are useful when attempting to assign common functionality to possibly unrelated classes.
D. Once a class implements an interface, all objects of that class have an is-a relationship with the interface type.
Rate this question:
A. A billing program where there is a variety of client types that are billed with different fee structures.
B. A maintenance log program where data for a variety of types of machines is collected and maintenance schedules are produced for each machine based on the data collected.
C. A program to compute a 5% savings account interest for a variety of clients.
D. An IRS program that maintains information on a variety of taxpayers and determines who to audit based on criteria for classes of taxpayers.
Rate this question:
A. execution.
B. compilation.
C. programming.
D. debugging.
Rate this question:
A. A subclass reference cannot be assigned to a superclass variable and a superclass reference cannot be assigned to a subclass variable.
B. A subclass reference can be assigned to a superclass variable and a superclass reference can be assigned to a subclass variable.
C. A superclass reference can be assigned to a subclass variable, but a subclass reference cannot be assigned to a superclass variable.
D. A subclass reference can be assigned to a superclass variable, but a superclass reference cannot be assigned to a subclass variable.
Rate this question:
A. final.
B. concrete.
C. abstract.
D. polymorphic.
Rate this question:
A. real classes.
B. instance classes.
C. implementable classes.
D. concrete classes.
Rate this question:
A. bold.
B. italics.
C. a diamond.
D. there is no convention of the UML to denote abstract classes—they are listed just as any other class.
Rate this question:
A. implementation inheritance.
B. interface inheritance.
C. Both. d. Neither.
C. Both.
Rate this question:
A. public int method1();
B. public int abstract method1();
C. public abstract int method1();
D. public int nonfinal method1();
Rate this question:
A. abstract superclasses may contain data.
B. abstract superclasses may not contain implementations of methods.
C. abstract superclasses must declare all methods as abstract.
D. abstract superclasses must declare all data members not given values as abstract.
Rate this question:
A. Must implement a method called calculate.
B. Will not be able to access the instance variable a.
C. Neither (a) nor (b).
D. Both (a) and (b)
Rate this question:
A. Method originalMethod cannot be overridden in class C—once it has been implemented in concrete class B, it is implicitly final.
B. Method originalMethod must be overridden in class C, or a syntax error will occur.
C. If method originalMethod is not overridden in class C but is called by an object of class C, an error occurs.
D. None of the above.
A. execution time binding.
B. execution binding.
C. just-in-time binding.
D. late binding.
Rate this question:
A. getClass.
B. getInformation.
C. objectClass.
D. objectInformation.
Rate this question:
A. because the subclass object has an object of its superclass.
B. because the subclass object is an object of its superclass.
C. only when the superclass is abstract.
D. only when the superclass is concrete.
Rate this question:
A. final methods allow inlining the code.
B. final methods and classes prevent further inheritance.
C. final methods are static.
D. final methods can improve performance.
Rate this question:
A. a method in an abstract class.
B. a private method.
C. a method declared in a final class.
D. static method.
Rate this question:
A. it will prepare the object for garbage collection.
B. it cannot be accessed from outside its class.
C. it cannot be overloaded.
D. it cannot be overridden.
Rate this question:
A. private static data and public abstract methods.
B. only public abstract methods.
C. public static final data and public abstract methods.
D. private static data and public final methods.
Rate this question:
A. forces classes that implement it to declare all the interface methods.
B. can be used in place of an abstract class when there is no default implementation to inherit.
C. is declared in a file by itself and is saved in a file with the same name as the interface followed by the .java extension.
D. can be instantiated.
Rate this question:
A. italics.
B. carets.
C. guillemets.
D. bold.
Rate this question:
0
1
2
D. any number of
Rate this question:
A. uses.
B. implements.
C. defines.
D. extends.
Rate this question:
A. A class that implements two interfaces.
B. A class that inherits from two classes.
C. A class that inherits from one class, and implements an interface.
D. All of the above are possible.
Rate this question:
A. public.
B. interface.
C. abstract.
D. final.
Rate this question:
A. private.
B. static.
C. abstract.
D. All of the above.
Rate this question:
Quiz Review Timeline (Updated): Mar 22, 2023 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.