/* related posts with thumb nails */

Illustrate the method overriding in JAVA.:

class Alpha

{

public void show()

{

System.out.println("Hello from Parent Class");

}

}

class Beta extends Alpha

{

public void show() //overriding

{

System.out.println("Hello from Child Class");

}

}

class Test

{

public static void main(String as[])

{

Beta b1=new Beta();

b1.show();

}

}

/* Output: */

Hello from Child Class

Related Topics:

0 comments:

Post a Comment