Object oriented programming language is a paradigm of programming which use the concept of object and class , if we look at the previous languages like c (procedural programming ) OOP is different .
In Object-oriented programming was developed because limitations were discovered in earlier approaches to programming. To appreciate what OOP does, we need to understand what these limitations are and how they arose from traditional programming languages.In these languages the most demerit is the data used are less secure like in c the global variable is used by all the function of a program .there is no any method to make the data private .If the program is too large then it's difficult to handle and its to complicated to understand because we can't classified the data and function to a specific area as we do in OOP using Class and Object Here you can see how a function is called from another function and we can call any function from any onewe can't make any function private .These are the demerit of the procedural language and OOP is used to come over from these situation .We will see how the function is called ,how is data is used in OOP but first understand that what is the Object and Class . To understand the concept of class and object look at the image given below , a car company first make the template of car and then give the physical existence so the template of the car is the class and when the cars comes to market that is object .and these object belongs to the class car . So we can define the class as template of data and function and in particular kind of object ,and the instance of the class is called Object.See how the class and object is used in programming (cpp) .If you are little bit familiar to the C , then consider on the use of structurewe use the structure like this .struct car { char name[20]; int wheel ; int grear ; }; Now if we have to use this structure (making physical existence ) then we write like thisstruct car maruti ,swift,bmw ;now we use these variable for programming need ..................The concept of Class and Object is much more similar to thisDeclaring a class(making template of class) class car{char name[20]; int wheel ; int grear ; }; Now if we have to use these data and it should be in physical existence .....that is the reason we make Objectcar maruti ,swift,bmw ; ( making the object)we can now use the variable of maruti ,swift,bmw as we need . We can define a function in class as we can't in structuresecond thing is the all member of structure is public but a class member can be public or private both(depending on programmer how he defines )In next article you will be familiar with c++ programming with concept of class and object . :)
0 comments: