Hi everyone.
So today we will start on your topic called woops object oriented programming.
So object oriented programming is a programming style that involves classes and objects classes and
objects so in this class we will learn the meaning of these two terms.
Now let us first understand the meaning of an object so object is a basic entity that possesses some
properties and functions in real world.
We are surrounded with objects everywhere.
For example laptop is an object and is an object.
Table is an object.
Change is an object etc. We want to involve these objects into our code because we want our code as
close as to the real world.
Okay let us first take an example suppose we have a student object
and let's say a student has property called Name
property or lumber a property.
Let's say each address property and let's say contact number
so these are some properties of Student object and we have functions.
So what other functions functions are.
The operation that we can perform on an object so let us take an example we can have a function called
change address we can have a function central number
and so on.
Okay so object are the basic entities that will have some properties and functions.
Now us go into the deal
Suppose I want to create 20 students
each student will have some properties.
So the student object will have some properties.
Let's say current living have only three properties and no functions.
Okay three property and no function name a general number three properties and we want to create 20
students.
So we will create student number one at will have name it will have age and district and will have rule
number similarly we will have as to name age number as three name age.
Rule number and so on we will create 20 such students.
So if we create.
So if we will create object using this method.
So this is a very hectic method okay.
It will take us a lot of time.
So what we use is a template called class.
So what we will do we will create a template.
So this template we'll have three properties name rule number and age.
Okay.
We have a template.
And this template has three properties name rule number and age.
So what we will do we will create a copy of this template
and we will name it as.
So we will have a name.
We will have a rule number.
And we will have each.
Now after creating the copy we will fill that data Latin name is ABC.
Rule number is tool a just 23.
Okay.
So we created a copy and then we will fill data.
Let's say we will create and copy
the name of these copies as true.
It will have a name.
It will have rule number and it will have each.
And now it's time to fill that data.
So let's say your name is X Y Z.
Rule number is 24.
And ages 50 to OK.
So this template is called a class.
And this copy of template is called Object similarly if you want to create more objects.
We can we will create a copy we will have three fields name rule number and age.
And then we will fill our data.
Okay.
So we have only one class.
And we can create many objects what we have to do.
Just copy that template and fill the data.
Okay.
So this is much much better as compared to this way.
Okay.
So and so if we will create the object using this this is very cumbersome method because all the objects
have these same properties name age and all number.
So it is better to create a template and this template will be called a class and then we will make
copy and fill data.
Okay.
So object is make the copy and filter data make a copy for the data.
Okay.
Now I hope you got a rough idea so I will become more clear as we go in detail in the future lessons.
So I think this is enough for three.
Now let us see the code how we will create class.
Let us see through a code so I have made a file with the name student dot CPB.
Okay.
So for creating a class we first have to write class keyword.
And then the name of the class.
So the name of the classes.
STUDENT.
OKAY.
Opening record closing record.
And this semicolon so let's say uh currently we have only two properties.
Rule number
and the second property.
Let's age.
Okay.
So this is a way to create a class.
This does index for creating a class.
Okay first class keyword then name of the class.
And then the properties.
Currently we do not have any functions.
Okay now let's see.
When for example so this is a class called the product NCP.
Sorry.
This is a file called product or TPB.
Let's make a class so class keyword then name of the class and then the name of the class is product
opening record closing record and semicolon.
Okay
let's see this product.
This product class has three properties.
First is I.T..
Second is uh lower tech albeit and third is uh let's call the name of the product.
So for name we have we need connectivity so connectivity.
Let's say the size is 50 OK
so we have a class called product.
It has three properties I.T. vid and name and this doesn't have any functions yet.
OK so now let us create object.
So we will discuss in the next video How to create objects.
So for objects what we have to do we have to make the copy of this class and then fill the data.
Okay so let us revise.
So what is the class.
Classes.
Basically a blueprint.
Class is a blueprint.
Let's take one more example let's say we have a class called God.
Okay.
Class God.
So this GA template this class blueprint let's say have four properties uh name Marty Lambert
let's say price and number of seats
okay So class is a blueprint.
Now we will make a copy C1.
Now we will have all the properties name more lumber price and seat number of seats.
And now it's time to fill the data.
Okay.
So let us the name is ABC model number two three forward price let's say 20 grand anti-gay and 30 seats
are full.
Okay.
So this blueprint class is a blueprint so blueprint doesn't have data.
Okay.
These are empty.
They are just the name of the field.
They are only names that do not contain any data.
If you want to fill the data what we will do we will make the copy of the template.
Then we will have all the fields all the properties and then we will fill data.
So objects are real world they are real while they are created after filling after filling the fields.
Okay.
So this is I always remember class using a blueprint class is a blueprint or a template
and object to real voids.
We will make the copy of the template and then we will fill the data.
Okay.
So in the next video we will learn how to create the object.
Okay.
In the next day we will learn how to create objects of class called product and objects of class called
student.
Okay thank you.