In this example we will show you how to use an enum inside a class in Java.
Source Code
package com.beginner.examples;
public class EnumInClass {
enum Score { // enum
A,
B,
C
}
public static void main(String[] args) {
Score s = Score.A;
System.out.println(s);
}
}
Output:
A