OOP is a technique to develop logical modules, such as classes that contains properties, fields and events. 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
Simula is considered as the first object-oriented programming language.
What is Class
Class is basic building block of OOP. A class contains data and behavior of entity.
What is an Object?
Object is an instance of a class. Any entity that has state and behavior is known as an object.
For example: chair, pen, table, keyboard, bike etc. It can be physical and logical. An object has three characteristics:
- State:- represents data (value)of an object.
- behavior(functionality):-represents the functionality of an object.
- identity:-object identity is typically implemented via a unique ID. The value of the ID is not visible to the external user. But it is used internally by the compiler to identify each object uniquely.
For example "keyboard" is an object .Its name dell color black know as its state. It is used for typing so, typing is it behavior.
Class is a template or blueprint from which object are created. So object is the instance of a class.
No comments:
Post a Comment