What’s the deal with this? I thought that children...
# getting-started
m
What’s the deal with this? I thought that children of enum classes were objects, so they should be able to be referenced statically? Why would a getter be necessary when an instance of the enum class can never change? I can’t edit the image apparently, but I’ve added one that’s more clear in the thread below
image.png
t
All enum constants are initialized in order when any of them is used for the first time. Since you are initializing a property of each constant whose value is immediately computed from Banana, Banana is not initialized yet. You have to use getters to make it work (just like
isOrange
)
💯 2