Consider the following classes: public abstract class Cat { private int age; private double weight; private double top_speed; public void run(double newSpeed) { ... } private void eat(double...



Consider the following classes:


public abstract class Cat {


       private int age;    private double weight;      private double top_speed;


       public void run(double newSpeed) { ... }


       private void eat(double portionSize) { ... }


// ... -> getXXX() and setXXX() methods here }


} public class Cheetah extends Cat {


private String type;


public Cheetah(int age, double wt, double sp, String type) {         this.type = type;  setAge(age);        setWeight(wt);         setTopSpeed(sp);


} private void run(double newSpeed) { ... }


public void camouflage() { ... } // ... ->


//     getXXX()


//     and setXXX() methods here }


}



Which design principles are violated by these classes? Explain it and then correct it



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here