Answers for "overrde vs overload java"

0

overrde vs overload java

class Dog{
    public void bark(){
        System.out.println("woof ");
    }
}
class Hound extends Dog{
    public void sniff(){
        System.out.println("sniff ");
    }
 
    public void bark(){
        System.out.println("bowl");
    }
}
 
public class OverridingTest{
    public static void main(String [] args){
        Dog dog = new Hound();
        dog.bark();
    }
}
Posted by: Guest on March-23-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language