java - creating enum constants with all class types? -


i have create emum wih class types.

enum should contain:

employee.class boarding.class address.class salary.class 

how can create enum above constants?

thanks!

enums own type, can't other class types. want enum holds reference other classes. maybe this.

public enum thing {   employee(employee.class),   boarding(boarding.class),   address(address.class),   salary(salary.class);    private final class clazz;   thing(class clazz) {     this.clazz = clazz;   }    public class getclassofthing() {     return clazz;   } } 

you might come better names though.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -