public class Enumvalues{
enum courseList {
JAVA,
C,
PYTHON,
PERL
}
enum generalInformation {
NAME,
AGE,
If you want to pass a single value from the enum
public class Test {
enum GeneralInformation{
NAME;
}
private static void print(GeneralInformation val){
System.out.println(val);
}
public static void main(String[] args) {
print(GeneralInformation.NAME);
}
}
else if you want whole class to be passed then, as it was not clear from the question
private static void print(Class> generalInfo){
}
public static void main(String[] args) {
print(GeneralInformation.class);
}