Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Cat extends Pet {
- date nextVaccineDate;
- public Cat(String n, date bd, date VAC{
- super (n, "cat", bd);
- nextVaccineDate = VAC;
- }
- public boolean isDueForVaccine(){
- return nextVaccineDate.compareTo(new date()) == -1;
- }
- public void vaccine(){
- nextVaccineDate.setDay(nextVaccineDate.d);
- nextVaccineDate.setMonth(nextVaccineDate.m);
- nextVaccineDate.setYear(nextVaccineDate.y++);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement