4 ms·
You are not correct regarding Java's enums. Define properties for your enum type, widen the constructor appropriately, and provide the accessor methods: https:
by eternalban 12y ago
You are not correct regarding Java's enums. Define properties for your enum type, widen the constructor appropriately, and provide the accessor methods:
https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.9 https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html...
- nightpool 12y agoThat's not the same thing. Rust enums are types, each with the possibility of having different fields that store data. Java enums are instances of a type, each with static data. (rust enums can have associated data too, but its not their main usage in idiomatic code)