Java OOP’s

This category contains Java OOP’s tutorials.

Enum in Java

In this tutorial, we will learn about Enum in Java. In Java Enum is a kind of class and it is used to represent a group of constants. For example days of week and months of the year etc. Enum is only used in case we know all the possible values(constants) on the time of compiling …

Enum in Java Read More »

Abstract vs Interface

In the last tutorials two tutorials, we learned about abstract class and interface. In this tutorial, we will learn what is the difference between Abstract class and Interface. Abstract class Interface An abstract class can have both abstract and non-abstract methods. But an Interface can have only abstract methods. We can not perform multiple inheritances in the abstract class. But in the case …

Abstract vs Interface Read More »

Interface in Java

In this tutorial, we will learn about Interface in Java. Interface is like an blue print of class. An Interface contain all its variable as static, final and all its methods as abstract. You can say an Interface is a complete Abstract class. We can not instantiate interface same as abstract class we can only use …

Interface in Java Read More »

Abstract class in Java

In this tutorial, we will learn about the Abstract class in Java. The main motive of creating an abstract class is to restrict the user to create an object of the class. Abstract classes can only be used with the help of inheritance means we can inherit the abstract class in class. Java provides us “abstract” which we can …

Abstract class in Java Read More »

Final Keyword in Java

In this tutorial, we will learn about the final keyword in Java. The main motive of the final keyword is to restrict the user and final keyword can be used to create three kinds of restriction. These are: final with variable final with method final with class Final keyword in Java with variable: The final keyword is to …

Final Keyword in Java Read More »

This Keyword in Java

In this tutorial we will learn about this Keyword in Java. In very simple words this keyword in Java references to object of the current class. At present, it might be sound confusing. But you will find it easy after checking the following example: Example code: Class ThisExample{ String name; public ThisExample(String name){ this.name=name; } public void show(){ …

This Keyword in Java Read More »

Inheritance in Java

In this tutorial, we will learn about Inheritance in Java. Inheritance is a mechanism in which we can inherit properties(methods and variable) of one class into another. This helps us to create a new class that will have its own properties and properties of its parent class(from which the new class is inheriting features). While performing …

Inheritance in Java Read More »

Scroll to Top