Java Enums
What is an Enum?
An enum is a special Java type that represents a fixed set of named constants, making code more readable and type-safe than using plain strings or numbers.
enum Status { PENDING, APPROVED, REJECTED }
Status s = Status.APPROVED;
Why Testers Use Enums
Enums are useful for representing a fixed set of values like HTTP methods or environment names, preventing typos that plain strings would allow (e.g., "aproved" instead of "APPROVED").
Previousa OOPS Concept: Encapsulation(Classes with the method, variables & logics)
Next Java Generics
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.
.png)