Enums Explained

Noobnoob
Jun 24, 2021

--

In Java, enumerations define a class type.

enum constants are static and final by default.

  • We can use the enum parameter in a switch case. This makes constants-driven computations better and faster.
  1. An Enumeration cannot inherit another class but can implement interfaces

Each entry in enum is an instance of enum Class.

Constructor is called with each entry creation

--

--

Noobnoob
Noobnoob

No responses yet