Author: misamaliraza94

  • Java Anonymous Class

    In this tutorial, you will learn about anonymous classes in Java with the help of examples. In Java, a class can contain another class known as nested class. It’s possible to create a nested class without giving any name. A nested class that doesn’t have any name is known as an anonymous class. An anonymous…

  • Nested Static Class

    In this tutorial, you will learn about nested static class with the help of examples. You will also learn about how static classes differs from inner classes. As learned in previous tutorials, we can have a class inside another class in Java. Such classes are known as nested classes. In Java, nested classes are of…

  • Nested and Inner Class

    In this tutorial, you will learn about the nested class in Java and its types with the help of examples. In Java, you can define a class within another class. Such class is known as nested class. For example, There are two types of nested classes you can create in Java. Non-static nested class (inner class)…

  • Java Encapsulation

    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…

  • 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…

  • 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.…

  • 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…

  • 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…

  • 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…

  • 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…