Object oriented programming(oop):
A computer program may be seen as a collection of individual objects, in opps we show everything as objects(object of class, object of structure, i.e.). each object is capable of receiving messages, processing data, and sending messages to other objects.In oops the objects usually instance of classes.
Most features of oop:
1. Classes:- class is a collection of members and functions, class can create instance (object) itself. Class have data and their access methods.there are many terms refer to class. the most common real time example of class is a class room of school.
Ex:- let school is a project where it should have classes to teach, in classes of school there are
students which called members of class. they may be girls and may be boys or both.
let there is a class named 9th_A and some members of it is ram, shyam, radha.so we can know about these members using class name. like ram from 9th_A, radha is in 9th_A.
so same in oop we can make instance of classes and access the members like:
9th_A obj1 =new 9th_a(); //instance of class
obj1.ram = 1; // accessing of member ram
obj1.radha = 2;
2. Data Abstraction: abstraction is a mechanism to re present only essential features which are of significance and hides the unimportant details.
Ex: An example of abstraction consider of a class vehicle, when we create the class vehicle what the function, code and data to put in class like vehicle name, no., fuel type, vehicle type etc.and functions like changing the gear, accelerating the vehicle. At this time we are not interested how vehicle works, how acceleration, changing gear take place.
4. Information hiding: Information hiding is the principle of the design decisions in a computer program that are most likely to change, thus protecting other parts of the program from extensive modification if the design decision is changed. The protection involves providing a stable interface which protects the remainder of the program from the implementation (the details that are most likely to change).