java - How to add special character in enum? -


I have a problem here. I have created a special careerfield java - an enum square which will list some special characters.

Special Protected Field. Java

  package bp.enumfield; Public Emma Special Character Field {+, #; }   

In my eclipse on this line: Public Enemy Special Character Field { there is an error in it: it says: Syntax error, Completing EnumDeclaration Please enter "EnumBody" for

Please help in advance thanks.

Do something like this,

  public enum Special Character Field {PLUS ( "+"), Hash ("#"); Private string value; Private Special Character field (string value) {this.value = value; } Public string toString () {return.value; // it will come back, # or +}}    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -