Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 12 of 12

Thread: OOPS Concept - Inheritance

  1. #1
    Junior Member
    Join Date
    May 2017
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default OOPS Concept - Inheritance

    Inheritance is the OOPS features:

    Inheritance means re-usability.for example

    son re-use his father sir name like father name is ranbir singh and son name is karan singh . so there is singh is a sir name.
    in java, there are three types of inheritance are supported, which are
    1) single inheritance
    2) multi-level inheritance
    3) hierarchical inheritance

    in java multiple inheritance are not supported through class bu it is possible through interface in java

  2. #2
    Senile Half-Wit Freaky Chris's Avatar
    Join Date
    Mar 2009
    Posts
    834
    My Mood
    Cynical
    Thanks
    7
    Thanked 105 Times in 90 Posts

    Default Re: OOPS Concept - Inheritance

    Did you have a specific question, perhaps regarding inheritance?

  3. #3
    Member John Joe's Avatar
    Join Date
    Jun 2017
    Posts
    268
    My Mood
    Amused
    Thanks
    8
    Thanked 18 Times in 18 Posts

    Default Re: OOPS Concept - Inheritance

    Looked like a small notes to me...
    Last edited by John Joe; June 22nd, 2017 at 04:33 AM.
    Whatever you are, be a good one

  4. #4

    Default Re: OOPS Concept - Inheritance

    The interface in java is a mechanism to achieve abstraction. There can be only abstract methods in the java interface not method body. It is used to achieve abstraction and multiple inheritance in Java. By interface, we can support the functionality of multiple inheritance.

  5. #5
    Member
    Join Date
    Dec 2013
    Location
    Honolulu
    Posts
    83
    Thanks
    1
    Thanked 4 Times in 2 Posts

    Default Re: OOPS Concept - Inheritance

    Back again. Thanks. This program is a lot of fun. The data you're talking about are at statically typed at compile time and known as reference type or objects. And runs on any platform. eg. Windows OS or Unix.

  6. #6
    Junior Member
    Join Date
    Feb 2018
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: OOPS Concept - Inheritance

    You can say partially this, but not fully as interface is having only abstract methods. Without interface you can directly write class and put your methods over there. Interface is designed for different purpose that is for specification design and all JAVA EE is based on interface specification like JDBC, Servlets, JSP, EJB all are interface and their implementations are provided by vendors like IBM, JBoss etc. It is wrong to say that interface in java is used for multiple inheritance only.

    Thanks,
    Binayak Nanda

  7. #7
    Junior Member
    Join Date
    Aug 2018
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: OOPS Concept - Inheritance

    Inheritance is an important pillar of OOP(Object Oriented Programming). It is the mechanism in java by which one class is allow to inherit the features(fields and methods) of another class.
    Important terminology:

    Super Class: The class whose features are inherited is known as super class(or a base class or a parent class).
    Sub Class: The class that inherits the other class is known as sub class(or a derived class, extended class, or child class). The subclass can add its own fields and methods in addition to the superclass fields and methods.
    Reusability: Inheritance supports the concept of “reusability”, i.e. when we want to create a new class and there is already a class that includes some of the code that we want, we can derive our new class from the existing class. By doing this, we are reusing the fields and methods of the existing class.

  8. #8
    Junior Member
    Join Date
    Oct 2018
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: OOPS Concept - Inheritance

    Inheritance is a key concept in the world of OOPs. Inheritance is one of the core concepts of object-oriented programming languages. It is a mechanism where you can to derive a class from another class for a hierarchy of classes that share a set of attributes and methods. Inheritance. In object-oriented programming, inheritance enables new objects to take on the properties of existing objects. A class that is used as the basis for inheritance is called a superclass or base class.

  9. #9
    Member
    Join Date
    Dec 2013
    Location
    Honolulu
    Posts
    83
    Thanks
    1
    Thanked 4 Times in 2 Posts

    Default Re: OOPS Concept - Inheritance

    This is a robust language. I have yet to master all the key concepts. Though I am learning it on windows, it is hard sometimes to see that it is not windows, but another programming language.

  10. #10
    Junior Member
    Join Date
    May 2019
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: OOPS Concept - Inheritance

    inheritance is a property in which the derived class inherits the property of the base class. Suppose class A is a parent class and class B is its derived class then class B will inherit the properties of class A, like which inherits some properties of our parents. This is the main concept of inheritance.
    Try to find out the Best Programming Institute in your city to learn to program.

  11. #11
    Junior Member
    Join Date
    Jul 2021
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: OOPS Concept - Inheritance

    Inheritance is a procedure of acquiring all the properties and behaviour of a parent class into child class. Inheritance represents “IS-A” relationship between super class and subclass. By inheriting we are reusing all the methods, properties and behavior of super class.
    Syntax:

    class SubClass extends SuperClass
    {
    // variables and methods
    }

    Types of inheritance in java - There are five types of inheritance in java single, multilevel, hierarchical, multiple and hybrid inheritance out of which three are supported in java.

  12. #12
    Member Helium c2's Avatar
    Join Date
    Nov 2023
    Location
    Kekaha, Kaua'i
    Posts
    88
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: OOPS Concept - Inheritance

    Thank you. Once again, too sharp. Reference type or objects. Got what I was looking for. Thanks! We're both operating on the same platform. So okay too.

Similar Threads

  1. JADE---Sending an Concept including an concept
    By HansDampf in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 25th, 2014, 12:22 AM
  2. how to approach oops
    By veera in forum Java Theory & Questions
    Replies: 2
    Last Post: August 1st, 2013, 02:23 PM
  3. HELP with Inheritance concept here
    By dreamincode in forum Java Theory & Questions
    Replies: 6
    Last Post: January 5th, 2013, 07:45 AM
  4. HELP with Inheritance concept here
    By dreamincode in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 3rd, 2013, 12:03 PM
  5. Java oops concept video for 10 min
    By jessie143143 in forum The Cafe
    Replies: 1
    Last Post: October 10th, 2011, 06:50 AM