Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public class Cat extends Pet {
  2. date nextVaccineDate;
  3.  
  4.  
  5. public Cat(String n, date bd, date VAC{
  6. super (n, "cat", bd);
  7. nextVaccineDate = VAC;
  8. }
  9.  
  10.  
  11.  
  12. public boolean isDueForVaccine(){
  13. return nextVaccineDate.compareTo(new date()) == -1;
  14. }
  15.  
  16.  
  17.  
  18. public void vaccine(){
  19. nextVaccineDate.setDay(nextVaccineDate.d);
  20. nextVaccineDate.setMonth(nextVaccineDate.m);
  21. nextVaccineDate.setYear(nextVaccineDate.y++);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement