Final keyword in Java can be applied to a Variable, Method or Class. Java keeps restrictions on those, that are declared final. In this tutorial, we shall learn about the final keyword, and its usage, with the help of illustrative example programs. Final keyword in Java Final keyword in Java canContinue Reading

Encapsulation is one of the four key concepts in OOPS (Object Oriented Programming) namely Inheritance, Encapsulation, Abstraction and Polymorphism. Following definition helps you to understand the concept of encapsulation: Encapsulation is a process of hiding the data from the users or in other words we can say it protects the code by preventingContinue Reading

An Interface in JAVA is able to achieve 100% abstraction as it only contains those methods which has no implementation (i.e. methods without body). In other words we can say interface can only contain method signature and fields. Starting JAVA 8 default and static methods can have implementation in theContinue Reading

Abstraction is one of the major building block. It is a process of hiding internal working and showing only necessary details. In simple form abstraction means: Show Functionality Hide Complexity Important Note: Interface is used to achieve 100% Abstraction in JAVA. Here we only discuss Abstraction in full details but weContinue Reading

Polymorphism means one name and many duties. Polymorphism refers to the ability of one thing to take many(Poly) distinct forms(Morphism). It is the property by which same message is send to objects of different classes and the objects behave differently. It is a very powerful concept that allows the designingContinue Reading

What is method overloading in Java Method overloading in Java is a programming concept when programmer declares two methods of the same name but with different method signature, e.g. change in the argument list or change in the type of argument. method overloading is a powerful Java programming technique toContinue Reading

Constructor in java is block of code which allows you to create instance of the object. It does not have return type.It has two main points Constructor name should be same as class Constructor should not have any return type else it will be same as method. There are three types ofContinue Reading

this keyword in java is used to refer to current object or instance of class. It can be used in the constructor to call any other overloaded constructor but this keyword should be the first statement in the constructor. This keyword can be used for instance variables this keyword can be used toContinue Reading

super Keyword in java is used to refer the object of the immediate superclass, and it is related to inheritance in java. Let’s say you have an instance variable or method of same name in subclass and superclass. How will JVM know which one are you referring to; superclass or subclass?That’s where you can use super keyword to refer superclass’s variables, methodsContinue Reading

The access modifiers in java define accessibility (scope) of variable, method, constructor or class. There are 4 types of access modifiers in java. Public access modifier Private access modifier Default access modifier Protected access modifier You don’t have to explicitly put the default modifier.JVM will use default modifier if you doContinue Reading