07 Enumerations and Nested Classes Flashcards

1
Q

It is a data type that contains a fixed set of constants.

A

Enumeration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Keyword that is used to create an enumeration.

A

enum

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The list of values of enum are called?

A

enum constants

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the non-static built-in methods of the enum constants?

A

toString()
ordinal()
equals(
compareTo()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Method that returns an integer that represents the constant’s position in the list of constants; the first position is 0.

A

ordinal()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Method that returns true if its argument is equal to the calling object’s value.

A

equals(

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Method that returns a negative integer if the calling object’s ordinal value is less that that of the argument, 0 if they are the same, and otherwise positive.

A

compareTo()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Method that return the name of the calling constant object.

A

toString()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the two (2) useful static methods used with enumerations?

A

valueOf()
values()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Method that accepts a string parameter and returns an enumeration constant.

A

valueOf()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Method tat returns an array of the enumerated constants.

A

values()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

It is used to describe a data type for that allows only appropriate behaviors.

A

type-safe

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

A class within another class is called?

A

Nested classes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the four (4) types of nested classes?

A

Static member class
Non-static member class (inner class)
Local class
Anonymous class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Type of class that has access to all static methods of the top-level class.

A

Static member class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Type of class that requires an instance; it has access to all data and methods of the top-level class.

A

Non-static member class (inner class)

17
Q

Type of class that is define within a method body.

A

Local class

18
Q

Type of class that is a special case of a local class that has not identifier

A

Anonymous class