In this tutorial, you will learn about encapsulation and data hiding in Java with the help of examples. Java Encapsulation Encapsulation is one of the key features of object-oriented programming. Encapsulation refers to the bundling of fields and methods inside a single class. It prevents outer classes from accessing and changing fields and methods of… Continue reading Java Encapsulation
Category: 5. Java OOP (II)
https://mybackup.infinitycodestudio.com/wp-content/uploads/2022/03/33.jpg
Java Polymorphism
In this tutorial, we will learn about Java polymorphism and its implementation with the help of examples. Polymorphism is an important concept of object-oriented programming. It simply means more than one form. That is, the same entity (method or operator or object) can perform different operations in different scenarios. Example: Java Polymorphism Output In the… Continue reading Java Polymorphism
Java Interface
In this tutorial, we will learn about Java interfaces. We will learn how to implement interfaces and when to use them in detail with the help of examples. An interface is a fully abstract class. It includes a group of abstract methods (methods without a body). We use the interface keyword to create an interface in Java.… Continue reading Java Interface
Abstract Class and Abstract Methods
In this tutorial, we will learn about Java abstract classes and methods with the help of examples. We will also learn about abstraction in Java. Java Abstract Class The abstract class in Java cannot be instantiated (we cannot create objects of abstract classes). We use the abstract keyword to declare an abstract class. For example, An abstract… Continue reading Abstract Class and Abstract Methods
Java super
In this tutorial, we will learn about the super keyword in Java with the help of examples. The super keyword in Java is used in subclasses to access superclass members (attributes, constructors and methods). Before we learn about the super keyword, make sure to know about Java inheritance. Uses of super keyword To call methods of the superclass that is… Continue reading Java super
Java Method Overriding
In this tutorial, we will learn about method overriding in Java with the help of examples. In the last tutorial, we learned about inheritance. Inheritance is an OOP property that allows us to derive a new class (subclass) from an existing class (superclass). The subclass inherits the attributes and methods of the superclass. Now, if… Continue reading Java Method Overriding
Java Inheritance
In this tutorial, we will learn about Java inheritance and its types with the help of example. Inheritance is one of the key features of OOP that allows us to create a new class from an existing class. The new class that is created is known as subclass (child or derived class) and the existing class from… Continue reading Java Inheritance