I am clear with advanced use of enum in java. Many of the points which differentiate them from regular classes and tells their need are also clear to me.
Can anyone give some practical example with sample code for advanced enum? Which can clearly elaborate about
where we should avoid classes and
should use enum instead
.
Please dont be confused. I am not asking for how to use enum or what is the use of enum. There are many questions and answers on this. I am looking for some real time/ live / practical example where we should avoid any other data type or classes.
Try this example:
Usage: