ENUMERATIONS AND NESTED CLASSES

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/25

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:11 AM on 5/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

26 Terms

1
New cards
Enumeration (enum)
A data type that contains a fixed set of constants
2
New cards
Enum constants
The specific values defined inside an enum that are the only allowed values
3
New cards
Type-safe
A feature where only valid values are allowed preventing invalid data at compile time
4
New cards
Enum declaration
The process of defining an enum using the enum keyword followed by constants
5
New cards
toString()
Returns the name of the enum constant as a string
6
New cards
ordinal()
Returns the position of the enum constant starting from 0
7
New cards
equals()
Compares two enum constants and returns true if they are the same
8
New cards
compareTo()
Compares the order of enum constants and returns a positive negative or zero value
9
New cards
valueOf()
Converts a string into its corresponding enum constant
10
New cards
values()
Returns an array containing all enum constants
11
New cards
Enhanced for loop
A loop used to iterate through all enum values using values()
12
New cards
Switch with enum
Using enum constants in a switch statement for cleaner and safer conditional logic
13
New cards
Comparison operators with enums
Using operators like == instead of compareTo() for direct comparison
14
New cards
Nested class
A class defined inside another class
15
New cards
Top-level class
The outer class that contains the nested class
16
New cards
Inner class
A non-static nested class that requires an instance of the outer class
17
New cards
Static member class
A nested class that can access only static members of the outer class
18
New cards
Local class
A class defined inside a method
19
New cards
Anonymous class
A class without a name used for one-time implementations
20
New cards
Private inner class
An inner class that is only accessible within its outer class
21
New cards
Encapsulation (nested classes)
Keeping related data and behavior together while hiding implementation details
22
New cards
Outer class access
The outer class can access members of its inner class
23
New cards
Inner class access
The inner class can access all members even private of the outer class
24
New cards
Code organization
Structuring code to make it easier to understand and maintain using nested classes
25
New cards
Tightly coupled classes
Classes that are closely related and often used together making nesting useful
26
New cards
Reusability limitation (inner class)
Inner classes are typically not reusable outside their outer class