Coding Conventions - Naming Enums

Posted by Walter White on Stack Overflow See other posts from Stack Overflow or by Walter White
Published on 2010-06-18T12:57:13Z Indexed on 2010/06/18 13:13 UTC
Read the original article Hit count: 330

Filed under:
|
|

Hi all,

Is there a document describing how to name enumerations?

My preference is that an enum is a type. So, for instance, you have an enum

Fruit{Apple,Orange,Banana,Pear, ... }

NetworkConnectionType{LAN,Data_3g,Data_4g, ... }

I am opposed to naming it:

FruitEnum
NetworkConnectionTypeEnum

I understand it is easy to pick off which files are enums, but then you would also have:

NetworkConnectionClass
FruitClass

Also, is there a good document describing the same for constants, where to declare them, etc.?

Walter

© Stack Overflow or respective owner

Related posts about java

Related posts about standards