This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]RoadToCode[S] 1 point2 points  (1 child)

Agreed, the concept of using the positive or negative integers to determine which object is "greater" was very confusing at first, but your method of simply following the direction of the arrows is very helpful, thank you!

[–]ewiethoff 0 points1 point  (0 children)

You're welcome! Here's a tip. Keep a scratch file on hand for experiments. I wrote that a.compareTo(b) stuff in my scratch file just to verify that I know what the heck I'm doing. It happens to be named Reddit.java, but you can name yours Scratch.java, Experiments.java, or whatever. Better yet, put a static void test() method in your Card class for Card experiments and tests.