Object Oriented Programming (OOP) is a programming paradigm that uses "objects" to design applications and computer programs. It utilizes several techniques from previously established paradigms, including inheritance, modularity, polymorphism and encapsulation. Object oriented programming may be seen as a collection of co-operating objects. In OOP each object is capable of receiving messages, processing data and sending messages to other objects. Each object can be viewed as an independent little machine with a distinct role of responsibility.
Five salient features of object oriented programming is given below:-
(a) Class - A class defines the abstract characteristics of a thing including the thing's characteristics and the things it can do. For example - The class Dog would consist of traits shared by all dogs, for example bread, fur color and the ability to bark.
(b) Object - A particular instance of a class. The class of Dog defines all possible dogs by listing the characteristics that they can have; the object lassie is one particular dog with particular versions of the characteristics.
(c) Inheritance - When an object or class inherits its traits from more that one ancestor class, and neither of these ancestors is an ancestor of the other, then it's called multiple inheritancd. For example - independent classes could define Dogs and Cats and a chimera object could be created from these two which inherits all the (multiple) behaviour of cats and dogs.
(d) Encapsulation - Encapsulation is achieved by specifying which classes may use the members of an object. The result is that each object exposes to any class a certain interface-those members accessible to that class.
(e) Polymorphism - Polymorphism is the ability of behavior to vary based on the conditions in which the behavior is invoked, that is two or more methods, as well as operators (such as +,-,* among others) can fit to many different conditions.
Five salient features of object oriented programming is given below:-
(a) Class - A class defines the abstract characteristics of a thing including the thing's characteristics and the things it can do. For example - The class Dog would consist of traits shared by all dogs, for example bread, fur color and the ability to bark.
(b) Object - A particular instance of a class. The class of Dog defines all possible dogs by listing the characteristics that they can have; the object lassie is one particular dog with particular versions of the characteristics.
(c) Inheritance - When an object or class inherits its traits from more that one ancestor class, and neither of these ancestors is an ancestor of the other, then it's called multiple inheritancd. For example - independent classes could define Dogs and Cats and a chimera object could be created from these two which inherits all the (multiple) behaviour of cats and dogs.
(d) Encapsulation - Encapsulation is achieved by specifying which classes may use the members of an object. The result is that each object exposes to any class a certain interface-those members accessible to that class.
(e) Polymorphism - Polymorphism is the ability of behavior to vary based on the conditions in which the behavior is invoked, that is two or more methods, as well as operators (such as +,-,* among others) can fit to many different conditions.
0 comments:
Post a Comment