Sharing my solution to the coding exercises from the book 'Practice Exams' by Bert Bates and Kathy Sierra. This solution seems fine to me, do correct me if I am wrong or if there would be a better way of coding it. Hope like minded souls would find this post useful. I will be posting my solutions to the other questions as and when I complete them. Thank you.
Create an enum that has a variable, a constructor, a method, and a
constant class body. Create a class that exercises each of the enum’s members.
Those cherries would go best on cherry cheesecake. Don't put those cherries on this tiny ad: