The Art and Science of JavaThe Art and Science of Java, a course book that uses the ACM library, has an exercise that reads like this.:
Now, this question is a little hard to understand, but nevertheless II've done a class that I think answers this:
Sorry about the commentaries, I. I speak portuguesePortuguese and II've written the commentaries in that language. I hope the code is easy enough to understand.
So my question isI want to know if I have written well the class, according to specifications, especially the Public Constants and the Get Methods.
I am not sure if they wanted me to make the Constants Intconstants int
types instead of StringsString
s. Also I didn't assign any parameters to the Get Methods, so they will only give me the rank or suit of a new Card Object. I am not sure if they wanted me to attribute an int param to these methods.
As a sidenote, I wrote then a short program that demonstrates this class in action, in choosing and displaying a random card (note that the run method is the main method in acmacm
libraries):