0
Java Shapes
Is it possible to solve the Shapes project by using enum?
3 Answers
+ 2
I don't really see what you can do with enums in this exercise.
Enums allow you to create constants, often used as an attribute of an entity, it cannot take a value other than that defined in the enum.
We also use enums in the database, which will make it possible to store entities with the same constraints.
In the exercise, the values will change depending on the context. we can't use constants
+ 1
You can practice the Factory pattern with enums in this exercise đ
https://code.sololearn.com/cVynQQlrrl8u/?ref=app
Decorator pattern is possible too
- 1
Have you tried?