Thursday, August 6, 2015

Object Oriented Programming Concepts (OOPS)


KEY CONCEPTS OF OBJECT-ORIENTED PROGRAMMING
OBJECT
Objects are primary run-time entities in an object-oriented programming.
Examples – Telephone, Book, Computer, car etc


CLASS
A class is grouping of objects having identical properties, common behavior, and shared relationship.
Exaple –
Class: Car
Properties: Company, Model, Color, Capacity.
Action: Speed (), Average (), and Break ()


METHOD
An operation required for an object or entity when coded in a class is called a method.



DATA ABSTRACTION
Abstraction directs to the procedure of representing essential features without including the background details.



ENCAPSULATION
The packing of data and functions into a single component is known as encapsulation.

INHERITANCE
Inheritance is the method by which objects of one class get the properties of objects of another class.




POLYMORPHISM
Polymorphism allows the same function to act differently in different classes.



DYNAMIC BINDING
Binding means connecting one program to another program that is to be executed in reply to the call.



REUSABILITY
Object-oriented technology allows reusability of the classes by extending them to other classes using inheritance.



Object: Object invokes other object behaviors.

1. Inheritance – Tata made Indica car à After 3 years later made Nono car. (Inherits properties, wheels, speed, starring, gear, break, accelerators etc) (Parent ß à child functions)
2. Encapsulation – Generally people shares their problem with parents but don’t like to share with friends, in other hand share their affair with friends and not comfortable to share with parents. Hiding information same time with other is called encapsulation. (Access modifier – public, private, protected)
3. Abstraction (hiding complexity) – In a company there are N number of employees; they have their different permanent address including HN, City, State, country and zip code. Create an address block with combining all the information (like - HN, City, State, country and zip code). And refer that block to the corresponding employee when needed. So combining the seprate information (like HN, City, state etc) and represent a single block (called Address) is known as Abstraction.

4. Polymorphism: I play a brother role for my younger sister, son for my parent and friend for my friends. I play different role for the different call. 


Java Platform Independence:

No comments:

Post a Comment