# OOPS

**Object Oriented Programming** paradigm follows certain fundamental concepts called:

## OOPs Concepts

**Class 🏫**\
A class defines the attributes and behaviors common to all objects of a certain kind.

> Think of a class like a blueprint to build something. It has all the needed tools and instructions.

**Object 🤖**\
An instance of a class, allocates memory and uses the class properties.

> When you use the blueprint to build a real thing, that's an object. Every thing you build is unique.

**Inheritance ️‍️️‍🔗**\
When a new class is defined based on an existing class, it inherits all the parent class's attributes and methods. The child can add or modify these as needed.

**Polymorphism️ ✌️**

Ability to treat objects with different internal structures interchangeably by interacting with them through a common interface. Redefines inherited methods.\
One name, multiple forms:

* **Method Overloading 📝** Same name, different parameters.
* **Method Overriding 📝** Redefining inherited methods in child class.

**Abstraction 📃**

abstraction involves defining common properties and behaviors that are shared across multiple entities, while leaving out specifics. This is done through abstraction layers like classes, interfaces, modules, etc.\
Hiding internal details and showing essential info:

* **Abstract Classes** 📃 Can have abstract and concrete methods.
* **Interfaces** 📃️ Only abstract methods and static final variables.

**Encapsulation 📦**

Bundling code and data together into a single unit (class) that hides its internal details from other code. Only exposes necessities through methods.\
Binding data and functions within a class. It helps achieve:

* **Information Hiding 🤐**
* **Loose Coupling ⚙️**
* **Maintainability 🛠️**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://qatesting.gitbook.io/qa/java/oops.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
