Author name: javaplanet.io

Abstract Keyword and Abstract classes

Java provides a powerful mechanism to achieve abstraction using the abstract keyword. Abstraction is a process of hiding implementation details and exposing only the essential features of an object. This mechanism allows developers to define classes and methods without implementing them, ensuring a structure that subclasses must follow. What is the ‘abstract’ Keyword? The abstract …

Abstract Keyword and Abstract classes Read More »

super keyword

The super keyword is a reference variable used to refer to the immediate parent class object. It is primarily used to access methods, constructors, and variables of the parent class from the subclass. Important Uses of ‘super’ keyword: Access Parent Class Constructor: The super() is used to call the constructor of the parent class. Access …

super keyword Read More »

Single Inheritance

Inheritance is one of the four fundamental Object-Oriented Programming (OOP) principles, alongside Encapsulation, Polymorphism, and Abstraction. Inheritance allows a class to inherit properties and behaviors (methods) from another class. This enables code reusability and a logical hierarchy. What is Single Inheritance? Single Inheritance refers to a situation where a class (child or derived class) inherits …

Single Inheritance Read More »

Inheritance Types

Inheritance is a fundamental concept in object-oriented programming that allows a new class to inherit properties and behaviours from an existing class. There are several types of inheritance: Single Inheritance A class inherits from only one superclass.Single Inheritance Promotes simplicity and avoids ambiguity in method resolution. Multiple Inheritance A class inherits from more than one …

Inheritance Types Read More »

Object class

Java is a class-based, object-oriented programming language, and at the root of its class hierarchy is the Object class. This class is the superclass of all classes in Java, meaning every class implicitly inherits from the Object class unless it explicitly extends another class. The Object class is part of the java.lang package and provides …

Object class Read More »

Inheritance Introduction

Inheritance is a fundamental concept in object-oriented programming (OOP) that allows a new class, called the “subclass” or “derived class,” to inherit attributes and behaviors from an existing class, known as the “superclass” or “base class.” The derived class can reuse, extend, or override the functionalities of the base class. Key points about inheritance Code …

Inheritance Introduction Read More »

Scroll to Top