Back to Course
Core Java

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").

Ready to master real-world software testing?

Learn manual and automation testing hands-on with mentor-led sessions.

Explore Course