Hi Folks...
I was trying out a certain exercise from the book 'murach's
Java SE6'. It's question 5 of esercise 9-4.The question from the book is as follow:
"Add a toString method to the CustomerType enumeration. This method should return a
string that contains "Retail Customer", 'Trade Customer" or "College
customer" depending on the customer type. Compile this class , then run the CustomerTypeApp class again to view the results of te toString method."
My code are as follow:
CustomerType
CustomerTypeApp
The question asks to return an appropriate string based on the customer type. I haven't gone to that extend of
returning based on the customer type as I seem to be having problem returing via the toString method. I understand that I cannot instantiate the enum in the 'CustomerTypeApp' class, how than do I call the toString method from withing the 'CustomerTypeApp' class? I hope someone can advise. Thanks.