3 ms·
Not in the same way. In Java, you can have an enum that has some data placed on it, at a per value basis. You can not have an enum where different instances o
by taeric 12y ago
Not in the same way. In Java, you can have an enum that has some data placed on it, at a per value basis. You can not have an enum where different instances of the same value have different values attached to it.
That is, Enum.A will always be Enum.A with the same data on it at all times in Java. This is not the case for ADTs.
- pcwalton 12y agoSure, but having enums with data is not per se out of the ordinary in mainstream languages.