ENUMERATION ENUM IN JAVA in Hindi Lecture 119

//Enum in Java 1.Enum in java is a data type that contains fixed set of constants Example--- enum Season{WINTER,SUMMER,SPRING,FALL} 2.Enum is a special class that defines a set of constants 3.Variable of that type must be equal to one of constant values that have been pre-defined. Example –direction is already defined Enum Direction{NORTH,SOUTH,,EAST,WEST} 4.It can be used for Example--- 1.Days of Week {SUNDAY,MONDAY,….} 2.Months {JANUARY,FEBRUARY,MARCH,….} 3.Color {RED,GREEN,BLUE….} 4.Planets {MARS,JUPITER,EARTH…} 5.The java enum constants are public static and final implicitly like interface data members are public static final Example--- directions values are public static and final 6.It is available from JDK 1.5 7.Java enums contain only fixed set of constants 8.Java constants are written in UPPER-CASE letters like in java.math class it contain PI as capital letter. Example---enum Season{WINTER,SUMMER…} WINTER,SUMMER are written in UPPER-CASE 9.Example1- Public enum Direction {NORTH,SOUTH,EAST…} Similar in class Public class Direction {………} Example2--- Public enum Season{WITNTER,SUMMER,FALL..} Public static void main(String args[]) { Season obj=Season.WINTER; //EnumName.Constants } Note about Enum------ 1.enum improves type safety 2.enum can be easily used in switch as we give multiple choices in switch 3.enum can have data members,constructors and methods where as interface contain data members and abstract methods 4.enum may inherit or implement many interfaces but cannot inherit or extends any class because it internally extends enum class. 5.new constants can be added without breaking the existing code. Example- Public enum Season{WINTER,SUMER,AUTUM..} As in this example we have added new value AUTUM. //Use of Enum enum Direction{NORTH,SOUTH,EAST,WEST; } class example { public static void main(String args[]) { Direction obj=Direction.WEST; System.out.println("value="+obj); } }

GENERIC CLASS WITH MULTIPLE PARAMETERS IN JAVA in Hindi Lecture 118
▶︎

GENERIC CLASS WITH MULTIPLE PARAMETERS IN JAVA in Hindi Lecture 118

Akshay Kumar CAN’T STOP LAUGHING At Sunil Grover’s Comedy 🤣 | TGIKS | Netflix India
▶︎

Akshay Kumar CAN’T STOP LAUGHING At Sunil Grover’s Comedy 🤣 | TGIKS | Netflix India

The AI factory: the rewiring of India's tech industry | FT Film
▶︎

The AI factory: the rewiring of India's tech industry | FT Film

ENUM CONSTANT WITH CONSTANT VALUES IN JAVA in Hindi Lecture 122
▶︎

ENUM CONSTANT WITH CONSTANT VALUES IN JAVA in Hindi Lecture 122

Using Large Language Models | Build Your Own LLM Workshop #1
▶︎

Using Large Language Models | Build Your Own LLM Workshop #1

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup
▶︎

Creator of C++: Bell Labs, Negative Overhead Abstraction, Mistakes | Bjarne Stroustrup

HOW ENUM WORKS AND VALUES( )  METHOD IN ENUM IN JAVA in Hindi Lecture 121
▶︎

HOW ENUM WORKS AND VALUES( ) METHOD IN ENUM IN JAVA in Hindi Lecture 121

ENUM IMPROVES TYPE SAFETY AND ENUM WITH SWITCH STATEMENT IN JAVA in Hindi Lecture 120
▶︎

ENUM IMPROVES TYPE SAFETY AND ENUM WITH SWITCH STATEMENT IN JAVA in Hindi Lecture 120

GENERICS AND GENERIC METHOD IN JAVA in Hindi Lecture 116
▶︎

GENERICS AND GENERIC METHOD IN JAVA in Hindi Lecture 116

5 AI Agent Terms You Need to Know
▶︎

5 AI Agent Terms You Need to Know

ASMR Best Triggers For Sleep Collection (No Talking) 3 Hours of Tapping & Scratching
▶︎

ASMR Best Triggers For Sleep Collection (No Talking) 3 Hours of Tapping & Scratching

From Child Prodigy to Winning Fields Medal, Nobel of Math
▶︎

From Child Prodigy to Winning Fields Medal, Nobel of Math

Java Full Course for Beginners
▶︎

Java Full Course for Beginners

10 Hidden Social Rules in Germany Nobody Warns You About!
▶︎

10 Hidden Social Rules in Germany Nobody Warns You About!

SQL Course for Beginners [Full Course]
▶︎

SQL Course for Beginners [Full Course]

Rust Programming Full Course  | Learn ⚙️ in 2024 | #rustprogramming #rust
▶︎

Rust Programming Full Course | Learn ⚙️ in 2024 | #rustprogramming #rust

If You Have A Bad Memory, I’ll Help You Fix It In 28 Minutes
▶︎

If You Have A Bad Memory, I’ll Help You Fix It In 28 Minutes

EXCLUSIVE | Saif Ali Khan On STABBING INCIDENT | "Would Forgive My Attacker" | Barkha Dutt
▶︎

EXCLUSIVE | Saif Ali Khan On STABBING INCIDENT | "Would Forgive My Attacker" | Barkha Dutt

Choosy Girls in Matrimonial Market | MATRIMANIA Episode 7 | Standup Comedy by Saikiran
▶︎

Choosy Girls in Matrimonial Market | MATRIMANIA Episode 7 | Standup Comedy by Saikiran

System Design Explained: APIs, Databases, Caching, CDNs, Load Balancing & Production Infra
▶︎

System Design Explained: APIs, Databases, Caching, CDNs, Load Balancing & Production Infra