I think these two topics are so similar that they sould be discussed as one. I have joined the two discussions.
I am pleased to see you indenting your code, but some of yur lines (e.g. line 71) are
too long and should be broken into two lines.
Don't use \n, and don't terminate what you are returning from
toString() with a line end sequence (line 83). Write
return rank + " of " + suit; Leave it to the method's user to decide whether to use
println() or
print() or similar.
I can see two serious problems. You have fields which are not marked
private.
You have duplicated data structures, particularly the
enums, which appear twice each. Such
enums should be written as top‑level types, not nested types.
There are lots of minor problems, which will lose you marks, but I shall keep quiet about them for now.
Don't use
Strings to pass information. You can pass the
enum elements directly. Looks at lines 44 and 76.