Wednesday, November 18, 2015

Program to implement single inheritance.

class Base
{
void display()
{
System.out.println("Base class Method");
}
}
class Derived extends Base
{
void show()
{
System.out.println("DeIived class Method");
}
}
class Inherit_Single
{
public static void main(String args[])
{
Derived obj=new Derived();
obj.display();
obj.show();
}
}
Output:

No comments:

Post a Comment