Results 1 to 1 of 1
Thread: A default Enumerated type
- 04-17-2010, 04:57 AM #1
Member
- Join Date
- Jan 2010
- Posts
- 46
- Rep Power
- 0
A default Enumerated type
Hey,
I am wondering if there is someway to make a default enum for example:
if I go and try to make a Black Color object then it will fail. but what if I was to have a default so any failing colors would become that default.Java Code:enum Color { RED, BLUE, GREEN ; }
for example political parties in a preferential voting system.
MBP - mildly boring party
VBP - very boring party
EBP - extremely boring party
IND - Independently boring and others
All new parties entering the election would be classed as IND, so that way if it was the FGT party or some such then it would become IND.
Is there a way to do this within the enum?
Similar Threads
-
how do I Parse Enumerated types?
By gcampton in forum New To JavaReplies: 5Last Post: 10-12-2009, 10:41 AM -
Problem using enumerated types
By Stryker4526 in forum New To JavaReplies: 3Last Post: 10-10-2009, 03:57 AM -
[SOLVED] Access to default session deniedAccess to default session denied
By jazz2k8 in forum NetworkingReplies: 1Last Post: 03-10-2009, 01:12 PM -
using instanceof to get Object type and parent type?
By xcallmejudasx in forum New To JavaReplies: 2Last Post: 11-06-2008, 06:24 PM -
[SOLVED] Cast string type to int type
By GilaMonster in forum New To JavaReplies: 9Last Post: 09-17-2008, 10:43 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks