 Hello everyone, this is Siddhas Kumar Uddhki here, working as assistant professor in Mechanical Engineering Department, Vachan Institute of Technology, Sholapur. Today we will be discussing about basic concepts of object oriented programming, which can be used for developing various programs. In the last video lecture, we had discussed about procedure oriented programming and object oriented programming. What is the approach followed? How is the process executed? Learning outcomes. At the end of this session, students will be able to understand and explain objects, classes, data abstraction and data encapsulation. The following topics will be discussed in this particular video lecture. Objects, classes, data abstraction, data encapsulation, objects. Objects are nothing but basic runtime entities in an object oriented system. They may represent a person, a bank account, a table of data or any item that the program has to handle. They may also represent a user defined data such as vectors, time and lists. Object oriented problem is analyzed in terms of objects and the nature of communication between them. Objects should be chosen in such a way so that they match closely with the real world objects. Objects take up space in the memory and have an associated address like a structure in C that is collection of similar data types. So when a program is executed, the objects interact by sending messages to one another. For example, if I take customer and account as two objects in a program of a bank, then the customer object may send a message to the account object requesting for the bank balance. Each object contains data and code to manipulate the data. Objects can interact without having to know details of each other's data or code. So it is sufficient to know type of message accepted and type of the response returned by the objects. Figure below shows the notations popularly used in object oriented analysis and design. So it basically consists of a student as an object, then various data members like name, date of birth, marks and functions like total, average and display. Earlier in this video lecture, we have discussed that objects contain data and code to manipulate that data. The entire set of data and code of an object can be made a user defined data with the help of a class. In fact, object is nothing but a variable of the type class. So once a class has been defined, we can create any number of objects belonging to that class. Each object is associated with the data of type class with which they are created. A class is thus just a collection of objects of similar type. For example, if I take mango and apple are members of class fruit. So this here mango and apple are objects. The another example may be tvsvgo and hondaactiva. They are the members of class two-wheeler vehicle. So classes are nothing but a user defined data types and behave like built-in data types of a programming language. So now we will be discussing what is data encapsulation. In normal terms, encapsulation is defined as wrapping up of data and information under a single unit. In object-oriented programming, encapsulation is defined as binding together the data and the function that manipulates them. Consider real-life example of encapsulation. In a company, there are different sections like the account section, finance section, sales section, etc. The finance section handles all the financial transactions and keeps records of all the data related to finance. Similarly, the sales section handles all the sales-related activities and keeps records of all the sales. Now there may arise a situation when for some reason an official from finance section needs all the data about sales in a particular month. In this case, he is not allowed to directly access the data of sales section. He will first have to contact some other officer in the sales section and then request him to give the particular data. This is what encapsulation is. Consider the data of sales section and the employees that can manipulate them are wrapped under a single name, sales section. And encapsulation also leads to data abstraction or hiding. As using encapsulation also hides the data in the above example, the data of any of the section like sales, finance or accounts is hidden from any other section. So the functions of the class act as an interface between the objects data and the program. So this is how does it looks. Encapsulation is C++, methods, variables. So the methods have an access to the different variables and data. So these are all packed under a single name called class, a type class unit. Now we will be discussing about data abstraction. Data abstraction is one of the most essential and important feature of object oriented programming in C++. Abstraction means displaying only essential information and here hiding the details. Data abstraction refers to providing only essential information about the data to the outside world, hiding the background details or implementation. Here is an example of a man driving a car. The man only knows that pressing the accelerators will increase the speed of a car or applying brakes will stop the car. But he does not know about how on pressing the accelerator the speed is actually increasing. He does not know about the inner mechanism of the car or the implementation of accelerator brakes, etc in the car. This is what abstraction is. Now this abstraction may be using classes. So in this class helps us to prove data members and member function using available access specifiers. A class can decide which data member will be visible to outside world and which is not. Abstraction in header files. One more type of abstraction in C++ can be header files. For example, consider the power method present in the math.h header file. So whenever we need to calculate the power of a number we simply call the function power method present in the math.h header file and pass the numbers as arguments without knowing the underlying algorithm according to which the function is actually calculating power of numbers. Abstraction using access specifiers. Access specifiers are the main pillar of implementing abstraction in C++. So we can use access specifiers to enforce restrictions on class members. Members declared as public in a class can be accessed from anywhere in the program. Members declared as private in a class can be accessed only from within the class. They are not allowed to be accessed from any part of code outside the class. So we can easily implement abstraction using the about two features provided by access specifier. Say the members that defines the internal implementation can be marked as private in a class and the important information needed to be given to the outside world can be marked as public and this public members can access the private members as they are inside the class. So now pause this video for a few seconds and try to think on this question. Wrapping up of data of different types in a single unit is known as encapsulation. Is it true or false? Yes it's true because we are packing the different types like the data members or whatever the data and functions into a single unit called class. So this process is known as encapsulation. Now these are the following references. Object oriented programming with C++ by E Baleguru Swamy and the different link second link. Thank you.