Java Enumerations - The Enum Type for an Enumeration - Java Programming Example - Appficial

preview_player
Показать описание
Enumeration type is a way to declare a data type which can only be assigned a value from a specific set of values
Items in the curly braces are named constant values

public enum Identifier {ENUMPERATION1, ENUMERATION2, ...}

When declaring an enumeration, include both the enumerated type and the enumerator within that type

Identifier someState = Identifer.ENUMERATION1;

Enumerations are typically used to illustrate a state machine, where the program behaves based on a current situation (state)

Increment and Decrement Operators

The While Loop

Infinite Loops

Do-While Loop

Do-While Loop Example Where User Prompts to Start Program Over

For Loop

Nested Loop

How to Determine Which Loop to Use?

Sentinal Value

Input Validation using Loops

Break and Continue Statements in a Looping Structure

Enumerations
Рекомендации по теме
Комментарии
Автор

Please SUBSCRIBE! More programming videos coming soon! ✌️

Appficial
Автор

You are now my favorite youtube reference for Java :) This simple explanation and example saves me a lot of time compared to other tutorial videos out there, Kudos!

hyunchae