---
title: "What is OOPs concept?"  
description: "What is OOPs concept?"  
author: "Nitin Kushwaha"  
published: 2019-07-12  
updated: 2019-07-16  
canonical: https://www.mindstick.com/forum/55170/what-is-oops-concept  
category: "java"  
tags: ["programming language"]  
reading_time: 2 minutes  

---

# What is OOPs concept?

[Please describe](https://www.mindstick.com/interview/33713/please-describe-the-relationship-between-seo-and-sem)...

## Replies

### Reply by Anonymous User

**OOPs (Object-Oriented Programming) Concept**;-

It is a method that can be used to create a program by using classes and objects.

They provide some concepts such as:-

- Objects.
- Classes.
- Inheritance.
- Polymorphism.
- Abstraction.
- Encapsulation.

## Object-

- Any entity that has identity and behavior.
- It is an instance of a class.
- It may be physical or logical.
- Example-chair, pen, fan, desk, etc.

**How to create an Object**:-

An object is created from classes, in Java.

Classname object=new classname();

Example-

Create an object and print value of i.

```
Class Student

{

int i=21;

public static void main(String args[])

{

Student s =  new Student();

System.out.println(s.i);

}

}

Output-

21
```

## Class;-

- It is a collection of an object.
- It is a logical entity.
- It does not contain any memory space.
- In other words, a class is a blueprint of an object.

Create a Class-

```
public class student

 {

  int m = 22;

}
```

Inheritance;-

- When one class is derived from another class.
- In other words when one object(child) holds all the properties of another object(parent) is called inheritance.
- Extend keyword is used to derive the class properties.

**Polymorphism**;-

- If one thing can be represented in different ways is called a Polymorphism.
- We can use Method overloading and Method overriding to achieve polymorphism, in java.
- For example an area of Circle, Rectangle, Square, etc.

## Abstraction

- It is a process of hiding details and shows essential details only to the users.
- Abstraction can be achieved either abstract classes or interfaces.
- abstract keyword is used.

**Encapsulation**;-

- It is a way to binding code into a single unit.
- Every Java class is an example of encapsulation.
- In encapsulation, we can use two methods-
- Setter used for, set the value.
- Getter used for, get the value

\


---

Original Source: https://www.mindstick.com/forum/55170/what-is-oops-concept

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
