30 September, 2020

write a java program for hybrid inheritance.

hybrid inheritance,hybrid inheritance in c++,hybrid inheritance program in c++,java programming,inheritance,hybrid inheritance in java?,what is hybrid inheritance in java,hybrid inheritance in c++ with example programs,single inheritance,hybrid inheritance in c++ with simple example programs,hybrid inheritance type,what is hybrid inheritance,c++ hybrid inheritance hindi,hybrid inheritance in c++ in tamil,java inheritance,java,inheritance in java,java inheritance example
class Animal
{
	void Walk()
	{
		System.out.println("Animal can Walk");
	}
}
class Man extends Animal
{
	void Walk()
	{
		System.out.println("Man can Walk using Two lags");
	}
	public static void main(String ar[])
	{
		Man m=new Man();
		m.Walk();
	}
}
class Lion extends Animal
{
	void Walk()
	{
		System.out.println("Lion can Walk using Four lags");
	}
	public static void main(String ar[])
	{
		Lion L=new Lion();
		L.Walk();
	}
}
class Dog extends Lion
{
	void Walk()
	{
		System.out.println("Dog can Walk using Four lags");
	}
	public static void main(String ar[])
	{
		Dog d=new Dog();
		d.Walk();
	}
}
27
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post
NEXT ARTICLE Next Post
PREVIOUS ARTICLE Previous Post