1 / 3100%
Q U ESTIO N
1
1. Classes and methods are declared final for all but the following reasons:
final methods allow inlining the code.
final methods and classes prevent further
inheritance.
final methods are static.
final methods can improve performance.
Q U ESTIO N
2
1. A class that implements an interface but does not declare all of the interface’s
methods must be declared
.
public.
interfac
e.
abstrac
t.
final.
Q U ESTIO N
3
1. Which keyword is used to specify that a class will define the methods of an interface?
uses
implemen
ts
defines
extends
Q U ESTIO N
4
1. A(n)
class cannot be instantiated.
final.
concrete.
abstract.
polymorphi
c.
Q U ESTIO N
5
1. Which of the following statements is false?
2.8 points
2.8 points
2.8 points
2.8 points
As of Java SE 8, any interface containing only one abstract method is known as a
functional interface.
There are many functional interfaces throughout the Java APIs.
Functional interfaces are used extensively with Java SE 8’s new lambda capabilities.
Anonymous methods provide a shorthand notation for creating lambdas.
Q U ESTIO N
6
1.
Which of the following statements about abstract superclasses is true?
abstract superclasses may contain data.
abstract superclasses may not contain implementations of methods.
abstract superclasses must declare all methods as abstract.
abstract superclasses must declare all data members not given
values as abstract.
Q U ESTIO N
7
1. All of the following methods are implicitly final except:
a method in an abstract
class.
a private method.
a method declared in a final
class.
static method.
Q U ESTIO N
8
1. Polymorphism allows for specifics to be dealt with during:
execution.
compilation
.
programmi
ng.
debugging.
Q U ESTIO N
9
1. Consider classes A, B and C, where A is an abstract superclass, B is a concrete class
that inherits from A and C is a concrete class that inherits from B. Class A declares abstract
method originalMethod, implemented in class B. Which of the following statements is true of
class C?
2.8 points
2.8 points
2.8 points
2.8 points
Method originalMethod cannot be overridden in class Conce it has been implemented
in concrete class B, it is implicitly final.
Method originalMethod must be overridden in class C, or a compilation error will occur.
If method originalMethod is not overridden in class C but is called by an object of class
C, an error occurs.
None of the above.
Q U ESTIO N
10
1. Polymorphism enables you to:
program in the general.
program in the specific.
absorb attributes and behavior from previous
classes.
hide information from the user.
Click Save and Submit to save and submit. Click Save All Answers to save all answers.
2.8 points
2.8 points
Students also viewed