Answer:
Step-by-step explanation:
The following is written in Java and has the methods as requested in the question...
class Dog {
private double age;
public Dog(double v) {
assert v >= 0:" Not valid";
this.age = v;
}
public boolean isOlder(Dog dog1, Dog dog2) {
if (dog1.age > dog2.age) {
return true;
} else {
return false;
}
}
}