☰ Topics

Features of Oops

Object-oriented programming deals with classes and objects.

Ojects are the real-world entities which have certain features and functionalities. A class is a factory or template of an object. All the objects which belongs to the features defined by any class are the objects of that class. We call it as a blueprint of how the object should be represented. For eg:- Mobile is a class and any particular mobile with attributes like model name, IMEI number, processor type etc and operations like dial, receive and sendmessage etc is an object. The object is also called as an instance of its class. For eg:- A mobile manufacturing company, at a time manufactures lacs of pieces of each model which are actually an instance. The objects are differentiated from each other via some identity or its characteristics. These characteristics are given some unique name.

As java is based on 100% oops features, it elininamtes the other features into only three main features i.e. Encapsulation, Polymorphism and Inheritance.

Encapsulation is defined as the process of enclosing one or more details from outside world through access right. It says how much access should be given to particular details. Encapsulation also includes abstraction which says what details to be made visible and encapsulation provides the level of access right to that visible details i.e. it implements the desired level of abstraction.
Eg:- When we switch on the bluetooth, we are able to connect another mobile but not able to access the other mobile features like dialing a number, accessing inbox etc. This is because, bluetooth feature is given some level of abstraction.

Polymorphism can be defined as the ability of doing the same operation but with different types of input. More precisely we can say it as 'many forms of single entity'. This play a vital role in the concept of OOPs. (Discussed later in detail)
Eg:- A mobile has camera to click a picture and the same mobile is having paronama mode available in camera, so functionality would be same but with mode.

Inheritance means the ability to extend the functionality from base entity in new entity belonging to same group. This will help us to reuse the functionality which is defined before. (Discussed later in detail)
Eg:- Basic mobile functionality is to send message, dial and receive call. So the brands of mobile is using the basic functionality and adding their own new features to their respective brand.