I'm trying to understand creating a Singleton Object using Enum. I wrote this code. Is this threadsafe?. Please tell me if not ,how to make this
public enum MySingleton {
INSTANCE;
private static final Employee emp = Employee.getInstance();
}
public class Employee {
private static Employee emp;
public static Employee getInstance(){
emp=new Employee();
return emp;
}
}