Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class VeterinaryReport {
- private int numberOfDogs;
- private int numberOfCats;
- public VeterinaryReport(int numberOfDogs, int numberOfCats){
- this.numberOfDogs = numberOfDogs;
- this.numberOfCats = numberOfCats;
- }
- public void showReport(){
- System.out.println(this.numberOfDogs + " dogs\n" + this.numberOfCats + " cats");
- }
- public static void main(String[] args){
- VeterinaryReport vr = new VeterinaryReport(12, 13);
- VeterinaryReport vr2 = new VeterinaryReport(100, 110);
- vr.showReport(); // shows 12 and 13
- vr2.showReport(); // shows 100 and 110
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement