Advertisement
Guest User

Untitled

a guest
Mar 25th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public class VeterinaryReport {
  2. private int numberOfDogs;
  3. private int numberOfCats;
  4.  
  5. public VeterinaryReport(int numberOfDogs, int numberOfCats){
  6. this.numberOfDogs = numberOfDogs;
  7. this.numberOfCats = numberOfCats;
  8. }
  9. public void showReport(){
  10. System.out.println(this.numberOfDogs + " dogs\n" + this.numberOfCats + " cats");
  11. }
  12.  
  13. public static void main(String[] args){
  14. VeterinaryReport vr = new VeterinaryReport(12, 13);
  15. VeterinaryReport vr2 = new VeterinaryReport(100, 110);
  16. vr.showReport(); // shows 12 and 13
  17. vr2.showReport(); // shows 100 and 110
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement