Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mattroseb8wk3;
- public class Day16A {
- public static void main(String[] args) {
- Aspin callAspin = new Aspin();
- callAspin.animalActions();
- }
- }
- class Animal {
- void animalActions() {
- classification();
- makeSound();
- move();
- eating();
- }
- void classification() {
- System.out.println("It is a mammal");
- }
- void makeSound() {
- System.out.println("The animal is making sounds");
- }
- void move() {
- System.out.println("Its moving on its 4 legs");
- }
- void eating() {
- System.out.println("It is an omnivore");
- }
- }
- class Aspin extends Animal {
- @Override
- void animalActions() {
- System.out.println("An Aspin are:");
- super.animalActions(); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- void makeSound() {
- System.out.println("Arf Arf Arf");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment