Filters
Question type

Study Flashcards

An interface can contain defined constants as well as method headings or instead of method headings.

A) True
B) False

Correct Answer

verifed

verified

True

A class that uses an interface must use the keyword:


A) Extends
B) Inherits
C) Super
D) Implements

E) All of the above
F) A) and D)

Correct Answer

verifed

verified

A common use of inner classes is :


A) clean up
B) set up
C) helper
D) all of the above

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

In Java,a derived class can have ________ base classes) .


A) one
B) two
C) three
D) there is no limit

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

If an inner class contains non static members,then the class name must be modified by the keyword:


A) Final
B) Static
C) Void
D) Protected

E) B) and C)
F) All of the above

Correct Answer

verifed

verified

When using the clone method from an inherited base class you should account for a _________ exception.


A) CloneNotFoundException
B) CloneEmptyException
C) CloneNotSupportedException
D) CloneNotEmptyException

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

Inner classes available outside the scope of their outer class are modified by the keyword:


A) Public
B) Private
C) Protected
D) Package access

E) A) and C)
F) All of the above

Correct Answer

verifed

verified

A

Why does Java only allow the inheritance of only one base class?

Correct Answer

verifed

verified

Java allows only one base clas...

View Answer

What are the rules of total ordering?

Correct Answer

verifed

verified

Total ordering says that the following r...

View Answer

A class that implements an interface but only gives definitions for some of the method headings given in the interface is called a/an:


A) concrete class
B) abstract class
C) discrete class
D) friendly class

E) None of the above
F) All of the above

Correct Answer

verifed

verified

What are the semantics of the Comparable interface?

Correct Answer

verifed

verified

The semantics of the Comparable interfac...

View Answer

An inner class definition is local to the outer class definition.

A) True
B) False

Correct Answer

verifed

verified

An interface may contain:


A) instance variables
B) primitive variables
C) constant variables
D) all of the above

E) A) and B)
F) None of the above

Correct Answer

verifed

verified

Java interfaces are a way of simulating multiple inheritance.

A) True
B) False

Correct Answer

verifed

verified

The compareTo method should return _____________ if the calling object equals the parameter.


A) A negative number
B) Zero
C) A positive number
D) Null

E) None of the above
F) A) and D)

Correct Answer

verifed

verified

A Java interface is an example of:


A) encapsulation
B) abstraction
C) polymorphism
D) all of the above

E) B) and D)
F) None of the above

Correct Answer

verifed

verified

The compiler and the run-time system enforces semantics on the Comparable interface.

A) True
B) False

Correct Answer

verifed

verified

The Comparable interface is in the ______________ package.


A) java.util
B) java.io
C) java.awt
D) java.lang

E) A) and B)
F) B) and C)

Correct Answer

verifed

verified

A class may only implement one interface.

A) True
B) False

Correct Answer

verifed

verified

False

Any constant variables defined in an interface must be defined as:


A) public
B) private
C) protected
D) package access

E) A) and B)
F) A) and D)

Correct Answer

verifed

verified

Showing 1 - 20 of 32

Related Exams

Show Answer