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 »

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