Create a public class Dog
that stores a single double
age set by the constructor.
(Reject negative ages using assert
.)
Dog
should also provide a single class method named isOlder
.
isOlder
should accept two Dog
instances and return true
if the first is older than the second, and false
otherwise.
You should also assert that both passed instances are not null.
So here is how Dog
should work:
You're challenge is to write tests for this problem described above.
Stuck? You may find these lessons helpful: