java - Why this enum doesn't compile? -
why enum doesn't compile?
public enum ackr implements cloneable{     instance;      public <ackr extends cloneable> ackr getinstance(){         return instance; //type mismatch: cannot convert ackr ackr //      return (ackr)instance; //type safety: unchecked cast ackr ackr     } }      
that type argument is, far know, not neccessary. try simply
public ackr getinstance(){     return instance; }      
Comments
Post a Comment