1class Dog{
2 public void bark(){
3 System.out.println("woof ");
4 }
5}
6class Hound extends Dog{
7 public void sniff(){
8 System.out.println("sniff ");
9 }
10
11 public void bark(){
12 System.out.println("bowl");
13 }
14}
15
16public class OverridingTest{
17 public static void main(String [] args){
18 Dog dog = new Hound();
19 dog.bark();
20 }
21}