Showing posts with label Enum Interview Questions & Answers. Show all posts
Showing posts with label Enum Interview Questions & Answers. Show all posts

May 01, 2016

#Java: Enum Interview Questions & Answers


What is Enum in Java?
  • Enumeration (Enum) in Java was introduced in JDK 1.5.
  • Most of the other programming languages like C, C++, etc also provide support for enumerations.
  • Enum is a keyword, a feature which is used to represent a fixed number of well-known values in Java, For example, number of days in a week.
  • Enum constants are implicitly static and final and you can not change their value once created. In short, enumeration is a list of named constants.
  • Enum in Java provides type-safety and can be used inside switch statements like int variables.