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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -