A) public.
B) interface.
C) abstract.
D) final.
Correct Answer
verified
Multiple Choice
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 compilation 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.
Correct Answer
verified
Multiple Choice
A) italics.
B) carets.
C) guillemets.
D) bold.
Correct Answer
verified
Multiple Choice
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.
Correct Answer
verified
Multiple Choice
A) final.
B) concrete.
C) abstract.
D) polymorphic.
Correct Answer
verified
Multiple Choice
A) References to interface types do not have access to method toString.
B) Method toString can be invoked implicitly on any object.
C) With inheritance,classes and their inherited classes tend to be very similar.
D) Dramatically different classes can often meaningfully implement the same interface.
Correct Answer
verified
Multiple Choice
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.
Correct Answer
verified
Multiple Choice
A) In Java SE 8,an interface may declare default methods-that is,public methods with concrete implementations that specify how an operation should be performed.
B) When a class implements an interface,the class receives the interface's default concrete implementations if it does not override them.
C) When you enhance an existing interface with default methods-any class that implemented the original interface will break.
D) With default methods,you can declare common method implementations in interfaces (rather than abstract classes) ,which gives you more flexibility in designing your classes.
Correct Answer
verified
Multiple Choice
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.
Correct Answer
verified
Multiple Choice
A) As of Java SE 8,any interface containing only one method is known as a functional interface.
B) There are many functional interfaces throughout the Java APIs.
C) Functional interfaces are used extensively with Java SE 8's new lambda capabilities.
D) Anonymous methods provide a shorthand notation for creating lambdas.
Correct Answer
verified
Multiple Choice
A) Prior to Java SE 8,it was common to associate with an interface a class containing static helper methods for working with objects that implemented the interface.
B) Class Collections contains many static helper methods for working with objects that implement interfaces Collection,List,Set and more.
C) Collections method sort can sort objects of any class that implements interface List.
D) With non-static interface methods,helper methods can now be declared directly in interfaces rather than in separate classes.
Correct Answer
verified
Multiple Choice
A) implementation inheritance.
B) interface inheritance.
C) Both.
D) Neither.
Correct Answer
verified
Multiple Choice
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.
Correct Answer
verified
Multiple Choice
A) early binding.
B) non-binding.
C) on-time binding.
D) late binding.
Correct Answer
verified
Multiple Choice
A) a method in an abstract class.
B) a private method.
C) a method declared in a final class.
D) static method.
Correct Answer
verified
Multiple Choice
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.
Correct Answer
verified
Multiple Choice
A) You should not call overridable methods from constructors-when creating a subclass object,this could lead to an overridden method being called before the subclass object is fully initialized.
B) It's OK to any of a class's methods from its constructors.
C) When you construct a subclass object,its constructor first calls one of the direct superclass's constructors.If the superclass constructor calls an overridable method,the subclass's version of that method will be called by the superclass constructor.
D) It's acceptable to call a static method from a constructor.
Correct Answer
verified
Multiple Choice
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.
Correct Answer
verified
Multiple Choice
A) execution.
B) compilation.
C) programming.
D) debugging.
Correct Answer
verified
Multiple Choice
A) 0
B) 1
C) 2
D) any number of
Correct Answer
verified
Showing 1 - 20 of 28
Related Exams