Call for New Batch / Any Query / Demo Classes : ☎ 08871209400 , 7987028543 , Zone-2,M.P.Nagar,Bhopal

Multilevel Inheritance in Java

Multilevel Inheritance is said to have taken place when a child class inherits from a parent class and then child class becomes the parent class for another class. This process can do on and on. For example, if class B inherits class A, then class C inherits from class B and similarly class D inherits from class C. Then class D may or may not use the members of all the previous classes.

A Sample Program showing Multilevel Inheritance


class Baby
{  
	void eat()
	{
		System.out.println("eating...");
	}  
}  
	class Sleep extends Baby
	{  
		void dream()
		{
			System.out.println("dreaming...");
		}  
	}  
	class Walk extends Sleep
	{  
		void talk()
		{
			System.out.println("talking...");
		}  
	}  
	
	class Check
{  
	public static void main(String args[])
	{  
	Walk d=new Walk();  
	d.talk();  
	d.dream();  
	d.eat();  
	}
} 
   

Program Output

Download Source code of Baby program share on :        :  

Love to hear your Views / Guidance / Recommendations on this Post…

Explore the Technology World

How to Build an App for the Google AssistantApps for the Google Assistant are the gateway for your users to engage with your services through Google Home, Android phones, iPhones.Watch here to build an as ...Read MoreIntroduction to AMP - Accelerated Mobile PagesAMP, short for Accelerated Mobile Pages, is new new open source initiative to make the mobile web awesome again.Watch Here the Introduction to AMP ...Read MoreHadoop - Just the Basics for Big Data Rookies (Best online tutorial)This Tutorials assumes absolutely no knowledge of Apache Hadoop and will provide a complete introduction to all the major aspects of the Hadoop ecosystem of pro ...Read MoreGoogle Python online tutorial-Interested in learning python? Then you must watch this videoPython is a dynamic, interpreted (bytecode-compiled) language. There are no type declarations of variables, parameters, functions, or methods in source code.wat ...Read Morelatest product and platform innovations at Google by Sundar PichaiLearn about the latest product and platform innovations at Google in a Keynote led by Sundar Pichai.Video is also subtitled in Chinese, Indonesian, Italian, Jap ...Read MoreFuture of the Java Platform and the JDKJava has been one of the most popular programming platforms in the world for twenty-three years as One Language, One Platform, a Lifetime of Opportunity. How d ...Read More

Call / Visit for New Batch

Services

Why Join Us

  • ➯ Free Demo Classes
  • ➯ No Registration Fee
  • ➯ Interview Questions
  • ➯ Study Materials
  • ➯ Softwares
  • ➯ Aptitude & Reasoning
  • ➯ Placement Assitance

Address

  • MyJava Training Institute ,
  • Plot No.243 , shop No 14 ,
  • Secnd Floor , Zone-II ,
  • M.P.Nagar , Bhopal,
  • Madhya Pradesh ( 462011 )
  • ☎  08871209400 , 7987028543
  • 🌐 www.myjava.in
FacebookGoogle +TwitterYouTube

MyJava - java Training Institute