Skip to content

Latest commit

Β 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Java Enum Practice

This is a simple Java console application that demonstrates the use of Enums and switch statements to classify days of the week as either weekdays or weekends.

πŸ“Œ What This Project Covers

  • Enums: Special types that represent fixed sets of constants (in this case, days of the week).
  • switch expressions: Modern switch syntax using arrow notation.
  • Input handling: Using Scanner to read user input from the console.
  • Exception handling: Gracefully managing invalid enum input with a try-catch block.

🧠 Concepts Practiced

Concept Description
enum Used to define a fixed set of named constants (MONDAY, TUESDAY, etc.)
switch Determines if a day is a weekday or weekend
Scanner Captures user input from the command line
try-catch Handles cases where user input doesn't match a valid enum

βœ… Example Run

Enter the day of the week: saturday
it is a weekend

About

Practicing special type of class that improve readability and important in switch

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages