And now we're using that last person within the my first filed not guilty.
Now the question arises Can we create a class of person separately like we used to do in case of Java.
The answer is yes.
So the source folder here.
I would simply create a right leg and create a new package like we create in case of Java.
And now let us give it some name.
On Dorte shrieks here.
OK.
You can give it a name as you wish.
And now inside the package you can also create one more class file.
So simply right click Create a new legacy Cartland file class and then simply use person and their type
of file that you want to create is actually the class.
So simply select class and who on.
OK so here we go.
Here is the package name Kandar streaks that within which this file is actually present right.
And inside this I have this class of person now inside this class of person I will do I just simply
got this statement from here.
And pasted within this Fluff's and now remove this last person from here and now here it shows that
unresolved person it cannot find a person because because we're actually working under their different
package.
So anybody find any error in case of intelligent Id simply press or at least enter what I remembered.
Oid place.
And in case of both Mac and Windows and simply click on import.
So here we got the import package called dark streaks dark person.
So it has simply imported the person Dorte getting file into our main file.
Right.
So here the error has gone and now we can use same person object or beam equal to Steve and then perform
the operation as Vivere performing here.
Right and now simply run the code.
So here we get the name of the person is Steve again.
Now now is similar to Java in case of Cartland.
We also have the concept of constructor.
So in order to create the constructor here the syntax is little bit different.
The constructor should be defined here only during the class declaration only.
So to define a constructor simply use Blackard.
Open and close and then within this simply define the variable name such as name calling string.
And now here whatever we do I will simply remove this statement from here and simply define a function.
Let's see this plea and now insert this.
I will simply gurt the print statement from here.
Control X and pasted within this function.
Right.
And now here I will simply remove the pollution because we don't need the person object here.
The name is sufficient here and here it says The name is actually unresolved.
So here inside the constructor we have to define the odd SPEEs name.
I just forgot to mention that here.
Right and now insert the mean file.
What would you do within the constructor.
We need to pass some value.
Let's see Steve.
And here let us remove it.
Remove this statement.
And now what we do is I will simply call the person object dord display method right and now add in
the called.
So here we get again the same output in the output console.
Now when the program is running then this statement is actually executed.
It simply passes the value of Steve inside the person class constructor and then when we call this method
of display then this method will be executed.
So this statement will be executed and we will get the name in the output.
So this was again a brief introduction of how the constructor looks like.
In case of Gorlin.
So I guess this was enough for the overview.
In this video for Cartland in the upcoming mortuis we discussed each and every concept that we discussed
in this video.
In a lot more detail.
So stated on the discourse and it get you guys in the next video.
Thank you.