Monday, 6 June 2016

OOPs Basics


Object Oriented Programming is a paradigm that provides many concepts such as-:

· Inheritence
· Overridding
· Polymorphism
· Abstraction
· Encapsulation

OOPs Concept:


Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies the software development and maintenance by providing some concepts:

· Object
· Class
· Inheritance
· Polymorphism
· Abstraction
· Encapsulation

Object - Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behaviors -wagging, barking, eating. An object is an instance of a class.

Class - A class can be defined as a template/blue print that describes the behaviors/states that object of its type support.

Inheritance - Inheritance can be defined as the process where one class acquires the properties (methods and fields) of another. With the use of inheritance the information is made manageable in a hierarchical order.

Polymorphism - Polymorphism is a concept by which we can perform a single action by different ways. Polymorphism is derived from 2 greek words: poly and morphs. The word "poly" means many and "morphs" means forms. So polymorphism means many forms.

Abstraction - Abstraction is a process of hiding the implementation details from the user, only the functionality will be provided to the user. In other words user will have the information on what the object does instead of how it does it.

Encapsulation - Encapsulation in Java is a mechanism of wrapping the data (variables) and code acting on the data (methods) together as as single unit.

No comments:

Post a Comment