public abstract class Shape { //Ivars private Color color; private int lineThickness; //Instance Methods public void setRandomColor() { //... } public void setRandomLineThickness() { //... } } public class Rectangle extends Shape { //... } public class RightTriangle extends Shape { //... } public class Circle extends Shape { //... }
public abstract class Pet { //Ivars private String name; private String favoriteFood; //Instance Methods public void setName(String nm) { //... } public void setFavoriteFood(String food) { //... } } public class Dog extends Pet { //... } public class Cat extends Pet { //... } public class Hamster extends Pet { //... }