Home Object Oriented Programming System What is Inheritance in JAVA in Hindi? | What is Inheritance in OOPs Concept?

What is Inheritance in JAVA in Hindi? | What is Inheritance in OOPs Concept?

0
What is Inheritance in JAVA in Hindi? | What is Inheritance in OOPs Concept?

What Inheritance in OOPs Concept?

Hello Friends! How Are You ?. I hope everything is better. Friends Today we want to discuss What is Inheritance in JAVA in Hindi ?.

It is very important to know that What is Inheritance in JAVA in Hindi? | What Inheritance in OOPs Concept ?. Everything is in this post so read all Content and tells that how useful this post is?

What is Inheritance in JAVA in Hindi? | What is Inheritance in OOPs Concept?

Inheritance OOPS का main feature होता है। इसमें old class से new class को create किया जाता है। इसके use से old class की property को new class में उपयोग किया जा सकता है।

इसके लिये old class को new class में inherit करना होता है। Inheritance में old class को Super class/Parent class/Base class और new class को Sub class/Child class/Derived class कहा जाता है।

Java में किसी class को दूसरी class में inherit करने के लिये extends keyword का use किया जाता है। जब एक class को दूसरी class में extends करते है तो यह सभी non-Private member including fields & method को inherit करता है ।

Inhertence का main उद्देस्य code को Reusebility Provide करना होता है।

जिससे class को केवल Unique feature write करना पड़े और remaning common property और funtionlity दूसरी class से extends कर सके ।

Syntax : –

class BaseClass{
// Statement here
}

class ChildClass extends BaseClass{
// Statement here
}

Subclass –

Class जो कि दूसरी class के features को extends करती है Subclass, child class or derived class कहलाती है।

Super class

Class जिसकी Properties और functionality दूसरी class द्वारा use किया जाता है Super class Parent class या Base class कहलाता है।

Advantages of Inheritance 

  1. Inheritance का मुख्य advantage यह है कि ऐसे code जो Base class मे already Prevent है उसे child class में दुबारा लिखने की आवश्यकता नहीं होती है
  2. Method Overriding के द्वारा यह Polymerphism को Support+/Promote करता है।

Read these contents –

  1. CSE final Year Vidhya ?
  2. What is File System ?
  3. Directory Structure of Laravel in Hindi ?
  4. What is Network Security in Hindi ?
  5. What is Applet in Java in Hindi  ?
  6. What is OOPs Concept In Hindi ?
  7. Laravel Installation in Windows ?

Disadvantage of Inheritance 

  1. Inheritance का main disadvantage यह है कि classes (Parent&Child) दोनों tightly coupled हो जाती है इसका अर्थ है कि यदि हम Parent class के code को हम change करते है तो यह सभी child class को Affect करेगा।
  2. इससे बचने के लिये दोनों classes को Independed होना पड़ेगा जोकि Possible नहीं है।

Final Word –

तो दोस्तों आज मैंने आप सभी को What is Inheritance in JAVA in Hindi ? के बारे में बताया हूँ| अगर आपको कोई भी Doubte हो तो Comment करके जरुर पूछे ।

तो दोस्तों मै आशा करता हूँ की आपको ये Post पसंद आई होगी। अगर आप को ये Post थोड़ी सी भी Useful/Helpful लगी हो Please Follow and Comment जरुर करे और इसे अपने दोस्तों के साथ Share करे! धन्यबाद|

LEAVE A REPLY

Please enter your comment!
Please enter your name here