Exam 13: Interfaces and Inner Classes

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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

Free
(True/False)
4.8/5
(34)
Correct Answer:
Verified

True

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

Free
(Multiple Choice)
4.7/5
(45)
Correct Answer:
Verified

C

The Serializable interface is like all the other Java interfaces in that it contains defined constants and method headings.

Free
(True/False)
4.9/5
(34)
Correct Answer:
Verified

False

A common use of inner classes is :

(Multiple Choice)
4.8/5
(26)

The method that must be implemented in a class using the Comparable interface is:

(Multiple Choice)
4.9/5
(31)

A class that uses an interface must use the keyword:

(Multiple Choice)
4.8/5
(36)

What are the obligations of a class that implements a specific interface?

(Essay)
4.9/5
(32)

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

(Multiple Choice)
4.9/5
(36)

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

(Multiple Choice)
4.8/5
(42)

What is an anonymous class?

(Essay)
4.8/5
(31)

Java source code that contains a class with an inner class,when compiled,will produce a separate .class file for the inner class.

(True/False)
4.9/5
(36)

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

(Multiple Choice)
4.7/5
(32)

When defining an inner class to be a helper class for an outer class,the inner classes access should be marked as:

(Multiple Choice)
5.0/5
(37)

Inner and outer classes do not have access to each other's private members.

(True/False)
4.9/5
(42)

An interface is a type.

(True/False)
4.7/5
(35)

An interface specifies the headings and definitions for methods that must be defined in any class that implements the interface.

(True/False)
4.9/5
(39)

A class may only implement one interface.

(True/False)
4.8/5
(40)

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

(True/False)
4.7/5
(39)

What are two advantages to using inner classes?

(Essay)
4.8/5
(39)

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

(Multiple Choice)
4.8/5
(38)
Showing 1 - 20 of 32
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)