Java 1.5 and Enums
As I'm currently not working I thought I would try and study for the Sun Certified Programmer examination. I was searching the web for concised information about the new features and found a nice slide show in the form of a powerpoint presentation on the new features of Java 1.5.
Anyway I am currently learning about enums. There is not really that much to learn if you have come from a C or C++ background however what is good is that there something to finally replace having to use int constants to represent enums in your programs e.g.
public static final int foo = 42;
public static final int bar = 43;
Now you can just use:
enum Foo { foo, bar}
More information about enums can be found in this Sun article "Enums".
0 Comments:
Post a Comment
<< Home