java oops

Interfaces

An interface in Java is a reference type that defines a set of abstract methods that a class must implement. Interfaces provide a way to achieve abstraction and multiple inheritance in Java. They act as a contract that a class must adhere to, specifying what methods must be implemented but not how they are implemented. …

Interfaces Read More »

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 »

Scroll to Top