1 00:00:02,790 --> 00:00:08,040 And now we're using that last person within the my first filed not guilty. 2 00:00:08,040 --> 00:00:14,270 Now the question arises Can we create a class of person separately like we used to do in case of Java. 3 00:00:14,430 --> 00:00:15,770 The answer is yes. 4 00:00:15,960 --> 00:00:17,850 So the source folder here. 5 00:00:17,850 --> 00:00:23,930 I would simply create a right leg and create a new package like we create in case of Java. 6 00:00:24,030 --> 00:00:26,020 And now let us give it some name. 7 00:00:26,260 --> 00:00:29,640 On Dorte shrieks here. 8 00:00:29,670 --> 00:00:30,270 OK. 9 00:00:30,600 --> 00:00:32,590 You can give it a name as you wish. 10 00:00:32,640 --> 00:00:36,960 And now inside the package you can also create one more class file. 11 00:00:37,140 --> 00:00:47,220 So simply right click Create a new legacy Cartland file class and then simply use person and their type 12 00:00:47,210 --> 00:00:50,170 of file that you want to create is actually the class. 13 00:00:50,230 --> 00:00:51,930 So simply select class and who on. 14 00:00:51,960 --> 00:00:53,640 OK so here we go. 15 00:00:53,650 --> 00:00:59,640 Here is the package name Kandar streaks that within which this file is actually present right. 16 00:00:59,800 --> 00:01:06,070 And inside this I have this class of person now inside this class of person I will do I just simply 17 00:01:06,130 --> 00:01:08,090 got this statement from here. 18 00:01:09,040 --> 00:01:16,500 And pasted within this Fluff's and now remove this last person from here and now here it shows that 19 00:01:16,590 --> 00:01:22,830 unresolved person it cannot find a person because because we're actually working under their different 20 00:01:22,830 --> 00:01:23,680 package. 21 00:01:24,120 --> 00:01:32,140 So anybody find any error in case of intelligent Id simply press or at least enter what I remembered. 22 00:01:32,250 --> 00:01:33,030 Oid place. 23 00:01:33,060 --> 00:01:37,870 And in case of both Mac and Windows and simply click on import. 24 00:01:38,370 --> 00:01:42,820 So here we got the import package called dark streaks dark person. 25 00:01:42,900 --> 00:01:47,830 So it has simply imported the person Dorte getting file into our main file. 26 00:01:47,830 --> 00:01:48,270 Right. 27 00:01:48,420 --> 00:01:56,390 So here the error has gone and now we can use same person object or beam equal to Steve and then perform 28 00:01:56,420 --> 00:01:59,490 the operation as Vivere performing here. 29 00:01:59,540 --> 00:02:02,630 Right and now simply run the code. 30 00:02:02,630 --> 00:02:06,200 So here we get the name of the person is Steve again. 31 00:02:06,470 --> 00:02:09,710 Now now is similar to Java in case of Cartland. 32 00:02:09,770 --> 00:02:12,350 We also have the concept of constructor. 33 00:02:12,560 --> 00:02:16,960 So in order to create the constructor here the syntax is little bit different. 34 00:02:16,970 --> 00:02:22,180 The constructor should be defined here only during the class declaration only. 35 00:02:22,190 --> 00:02:25,240 So to define a constructor simply use Blackard. 36 00:02:25,250 --> 00:02:33,750 Open and close and then within this simply define the variable name such as name calling string. 37 00:02:33,800 --> 00:02:39,340 And now here whatever we do I will simply remove this statement from here and simply define a function. 38 00:02:39,350 --> 00:02:42,010 Let's see this plea and now insert this. 39 00:02:42,050 --> 00:02:45,520 I will simply gurt the print statement from here. 40 00:02:47,630 --> 00:02:50,700 Control X and pasted within this function. 41 00:02:50,750 --> 00:02:51,380 Right. 42 00:02:51,590 --> 00:02:56,700 And now here I will simply remove the pollution because we don't need the person object here. 43 00:02:56,960 --> 00:03:02,110 The name is sufficient here and here it says The name is actually unresolved. 44 00:03:02,150 --> 00:03:06,930 So here inside the constructor we have to define the odd SPEEs name. 45 00:03:07,070 --> 00:03:09,250 I just forgot to mention that here. 46 00:03:09,480 --> 00:03:11,660 Right and now insert the mean file. 47 00:03:11,660 --> 00:03:14,050 What would you do within the constructor. 48 00:03:14,060 --> 00:03:15,550 We need to pass some value. 49 00:03:15,680 --> 00:03:17,080 Let's see Steve. 50 00:03:17,300 --> 00:03:19,770 And here let us remove it. 51 00:03:19,780 --> 00:03:21,180 Remove this statement. 52 00:03:22,260 --> 00:03:29,470 And now what we do is I will simply call the person object dord display method right and now add in 53 00:03:29,470 --> 00:03:31,370 the called. 54 00:03:31,430 --> 00:03:35,090 So here we get again the same output in the output console. 55 00:03:35,090 --> 00:03:38,930 Now when the program is running then this statement is actually executed. 56 00:03:38,990 --> 00:03:45,140 It simply passes the value of Steve inside the person class constructor and then when we call this method 57 00:03:45,140 --> 00:03:48,410 of display then this method will be executed. 58 00:03:48,470 --> 00:03:53,010 So this statement will be executed and we will get the name in the output. 59 00:03:53,030 --> 00:03:57,410 So this was again a brief introduction of how the constructor looks like. 60 00:03:57,410 --> 00:03:59,360 In case of Gorlin. 61 00:03:59,360 --> 00:04:02,060 So I guess this was enough for the overview. 62 00:04:02,090 --> 00:04:08,360 In this video for Cartland in the upcoming mortuis we discussed each and every concept that we discussed 63 00:04:08,390 --> 00:04:09,310 in this video. 64 00:04:09,310 --> 00:04:10,840 In a lot more detail. 65 00:04:10,970 --> 00:04:14,480 So stated on the discourse and it get you guys in the next video. 66 00:04:14,480 --> 00:04:14,990 Thank you.