Write a Java-program using static method overridding

Write a Java-program using static method overridding

Program
class Demo
{
    static void show()
    {
        System.out.println("hi");
    }
}
class Demo1 extends Demo
{
    static void show(int x)
    {
        System.out.println("welcome");
    }
}
public class Main
{
    public static void main(String args[])
    {
        Demo1.show();
        Demo1.show(10);
    }
}

Output:

hi
welcome


Polymorphism In Java



More Questions


151 . Write a Java-program using Constructor overloading
152 . Write a Java-program using static method overridding
153 . Write a Java-program using dynamic method overridding
154 . Write a java program to illustrate inner class accessing inner class properties
155 . Write a package Program
156 . Write a package program using encapsulation
157 . Write a package program using data abstraction
158 . Write a package program using inheritance
159 . write a package program using polymorphism
160 . write a inner package program using polymorphism
161 . Write a program to handled the Arithmetic Exception