• Post Reply Bookmark Topic Watch Topic
  • New Topic

Typesafe Enumerations  RSS feed

 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have attempted to write a typesafe enum that is serializable, however, I'm getting unexpected results.

The following code produces the output:


I was expecting:


Apologies for the lengthy source, it's as small as I could possibly get it while still demonstrating the problem:

 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


changed to:



 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!