Java Inheritance In Hindi (जावा इन्हेरिटेंस क्या है ?)

Java Inheritance In Hindi
 


Java Inheritance In Hindi :

Inheritance एक ऐसा mechanism है। जिसमे एक class की properties और methods को किसी दुसरे class में उपयोग किया जा सकता है | अर्थात child class अपने parent class के properties और methods को inherit करती है।
parent class को  base class , super class और child class को sub class , derived class भी कहा जाता है।inheritance IS-A relationship को represent करता है जिसे parent-child relationship भी कहा जाता है।
जावा में इनहेरिटेंस का उपयोग Method Overriding और  Code Reusability के लिए किया जाता है।

Syntax for Inheritance :

class Subclass-name extends Superclass-name  
{  
   //methods and fields  
}

Types of Inheritance in Java  : Java Inheritance कितने प्रकार के होते हैं ?

Inheritance पांच प्रकार के होते  है | लेकिन जावा multiple inheritance को सपोर्ट नहीं करती है। इसलिए जावा मे चार प्रकार के Inheritance होते है |
  1. Single Inheritance
  2. Multilevel Inheritance
  3. Hierarchical Inheritance
  4. Hybrid Inheritance


अगर आपको यह पोस्ट 📑 पसंद आई हो तो अपने मित्रों के साथ जरूर शेयर करें। धन्यवाद !
Maxon

Hello there! I'm Maxon, a dedicated UI/UX designer on a mission to transform digital experiences into intuitive, user-centric journeys. With a keen eye for detail and a passion for crafting aesthetically pleasing interfaces, I strive to create designs that not only look stunning but also enhance usability and functionality.

Post a Comment

Previous Post Next Post