Java enums

In this tutorial, we will learn about enums in Java. We will learn to create and use enums and enum classes with the help of examples. In Java, an enum (short for enumeration) is a type that has a fixed set of constant values. We use the enum keyword to declare enums. For example, Here, we have… Continue reading Java enums

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… Continue reading Java Anonymous Class

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… Continue reading Nested Static Class

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)… Continue reading Nested and 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… Continue reading Java Encapsulation

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

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