- public class Dog {
- private float height;
- private float weight;
- public Dog(float height, float weight) {
- this.height = height;
- this.weight = weight;
- }
- public void walk() {
- //walking
- }
- }
- public class BullDog extends Dog {
- public void walk() {
- //bulldog walking
- }
- }
- public class ChihuahuaDog extends Dog {
- public void walk() {
- //chihuahua walking
- }
- }