Uml Class Diagram Class Class Dog Private String Name Private String Type Private Int Age Q11556377

. A UML class diagram for each class. class Dog { private Stringname; private String type; private int age; public Dog(){} publicDog(String n,String t,int a) { name=n;type=t;age=a; } public voidprint() { System.out.println(“Name:”+name+” Type:”+type+”Age:”+age); } } class Cat { private String name; private Stringtype; private int age; public Cat(){} public Cat(String n,Stringt,int a) { name=n;type=t;age=a; } public void print() {System.out.println(“Name:”+name+” Type:”+type+” Age:”+age); } }public class Pound { private Cat[] cats = new Cat[10]; privateDog[] dogs = new Dog[15]; private int catCount = 0; private intdogCount = 0; public Pound() {} public void addDog(Dog d1) {dogs[dogCount] = d1; dogCount++; } public void addCat(Cat c1) {cats[catCount] = c1; catCount++; } public void printAnimals() {System.out.println(“Printing Dogs:”); for(int i = 0; i

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *