hi ,
I'm java developer
in java it is Objects instead of integer constants .
I want to ask this question
What is the fundamental difference between the two ?
Printable View
hi ,
I'm java developer
in java it is Objects instead of integer constants .
I want to ask this question
What is the fundamental difference between the two ?
In C/C++, enums are more or less integers (that's the way they are handled under the hood). You can't give your enum methods or anything like that, basically you only capable of making variables of the type and giving them the values you list.
In Java, your enums can have methods attached, so if you have:
It's a bit more complex than this, but that's the jist of it. You can read about it on Sun's site here: http://java.sun.com/j2se/1.5.0/docs/...age/enums.html.Code:enum bla{
BLA1, BLA2, BLA3;
public void doStuff(){
// stuff
}
}
BLA1.doStuff();
thanks, IllegalCharacter
that's was very helpful.