• Home
  • Java
    • Java Basics
  • Kafka
    • Producer
  • AWS
  • GoLang
  • About Me
mjpric3@gmail.com
Curriculum Vitae

The Code Standard

  • Home
  • Java
    • Java Basics
  • Kafka
    • Producer
  • AWS
  • GoLang
  • About Me

Inheritance

Basics

is one of the four pillars of Java. Its purpose is what it sounds like, to inherit some attributes and functionality from a super class or sometime referred to as “Parent” class to its child class. 

Benefit: 

  1. Allows us to share common code among sub-classes of the super class.
  2. Allows for more manageable code and refactoring.
  3. Allows for application to be more easily extendable.
  4. Maybe one of the most important things, is that it allows us to use Polymorphism. 

Example: An object is said to be a child if it has an “IS-A” Relationship with  another class. If it does, you may like to use the java keyword extends to inherit the fields and method of the super class. Here is a high-level example of some basic inheritance involving animals. Note that even though a Wolf and Dog extend the Canine class, they will inherit all attributes from the Canine class and the Mammal class. 

You also might be interested in

Learning Java

Dec 22, 2018

Java OOP Java is an object oriented programming language that[...]

What Is A Computer?

Dec 21, 2018

First we will start off with the dictionary definition of[...]

Polymorphism

Jan 3, 2019

Polymorphism is a key component of Java’s Object Oriented Nature.[...]

Recent Posts

  • Producer
  • Interfaces
  • Abstraction
  • Polymorphism
  • Conditional Statements

Categories

  • Basics
  • Kafka
  • Welcome

© 2026 · thecodestandard.com

Prev Next