Java OOPS

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 which will have its own properties and properties of its parent class(from which new class is inheriting features). While performing …

Inheritance 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: In the above example, you can see we have …

This Keyword in Java Read More »

Static Keyword in Java

In this tutorial, we will learn about static keyword in Java. The main motive of the static keyword in Java is memory management. We can use static keyword with variable, method and block. An important thing to know that a static method, variable and block can be used without creating an object of the class. …

Static Keyword in Java Read More »

Constructor in Java

In this tutorial, we will learn about Constructor in Java. The constructor looks exactly the same as a normal method but there is some difference between constructor and method check these: The contractor has no explicit return type Name of constructor would same as class name We can not make a constructor abstract, static, final, and …

Constructor in Java Read More »

Class and Object in Java

In this tutorial, we will learn about Class and Object in Java. We are using the class keyword from our very first tutorial of this series. As we learned in previous tutorials Java is an Object-Oriented programming language. It means we can not write anything(variables and methods) outside the scope of the class. Class is a …

Class and Object in Java Read More »