Skip to main content

Posts

Showing posts from 2015

What will be the Output?

class Parent {    static void show() { System.out.println("static show in Parent"); }    void show1() { System.out.println("Parent show1"); } } class Child extends Parent {    static void show() { System.out.println("static show in Child"); }    void show1() { System.out.println("Child show1"); }    public static void main(String rk[]) { Parent p = new Child(); p.show(); p.show1(); } } Predict the output and draw a conclusion from that regarding the invocation of static and non-static methods.