- class
- object
- inheritance
- polymorphism
- abstraction
- encapsulation
- interfaces
class:
a class is a basic building block. It can be defined as template that describes the data and behaviour associated with the class instantiation. Instantiating is a class is to create an object (variable) of that class that can be used to access the member variables and methods of the class.
A class can also be called a logical template to create the objects that share common properties and methods.
Example:
<access specifier> class class_name
{
// member variables
// class methods
}
Object:
The Object class is the parent class of all the classes in java by default. (OR) object is a memory referance from class (OR) object is instantiation from class.
Example:
Object obj=getObject();
Encapsulation:
Encapsulation in Java is a process of wrapping code and data together into a single unit, for example, a capsule which is mixed of several medicines.

We can create a fully encapsulated class in Java by making all the data members of the class private. Now we can use setter and getter methods to set and get the data in it.
The Java Bean class is the example of a fully encapsulated class.
Advantage of Encapsulation in Java
By providing only a setter or getter method, you can make the class read-only or write-only. In other words, you can skip the getter or setter methods.
Inheritance:
Is a mechanism in which one object acquires all the properties and behaviors of a parent object. It is an important part of OOPs (Object Oriented programming system).
The idea behind inheritance in Java is that you can create new classes that are built upon existing classes. When you inherit from an existing class, you can reuse methods and fields of the parent class. Moreover, you can add new methods and fields in your current class also.
Inheritance represents the IS-A relationship which is also known as a parent-child relationship.
Why use inheritance in java
- For Method Overriding (so runtime polymorphism can be achieved).
- For Code Reusability.
class Subclass-name extends Superclass-name
{
//methods and fields
}