You are on page 1of 1

Practical 17.

class Animal{

void move(){

System.out.println("Animal is moving");

class Dog extends Animal{

void move(){

super.move();

System.out.println("Dog is moving");

class Override{

public static void main(String args[]){

Dog d = new Dog();

d.move();

Output

Animal is moving

Dog is moving

You might also like