1 00:00:00,210 --> 00:00:03,870 Before we start, did you try solving the workbook yourself? 2 00:00:03,900 --> 00:00:09,660 If not, please click the link in the resources folder and follow the instructions for this workbook. 3 00:00:10,970 --> 00:00:13,100 Welcome to Workbook 7.7. 4 00:00:13,100 --> 00:00:16,100 In this workbook, we're just going to print our object. 5 00:00:16,100 --> 00:00:22,010 And by virtue of adding our two string method to the person class, it's going to get called whenever 6 00:00:22,010 --> 00:00:24,490 we print an object of that class. 7 00:00:24,500 --> 00:00:28,790 So here we'll say public string to string. 8 00:00:32,560 --> 00:00:35,740 And we're just going to return the following string. 9 00:00:38,090 --> 00:00:43,160 Here, we can fill in all the placeholders, pause the video, and feel free to do that one yourself. 10 00:00:48,270 --> 00:00:50,330 So I hope you ended up with the following here. 11 00:00:50,340 --> 00:00:56,040 We're just printing every single field in the object that's calling the two string method, and an object 12 00:00:56,040 --> 00:00:59,140 will call the two string method whenever it's being printed. 13 00:00:59,160 --> 00:01:01,140 So here I'm just going to print. 14 00:01:02,000 --> 00:01:06,680 The person object and let us visualize the runtime. 15 00:01:06,680 --> 00:01:10,100 So what I'm going to do is add a breakpoint over here. 16 00:01:11,510 --> 00:01:12,500 One here. 17 00:01:12,770 --> 00:01:13,940 Press debug. 18 00:01:15,550 --> 00:01:21,600 And by virtue of printing and object of the person class, it's going to call the two string method. 19 00:01:21,610 --> 00:01:22,960 Let's press continue. 20 00:01:23,200 --> 00:01:24,440 Indeed it does. 21 00:01:24,460 --> 00:01:28,150 This points to the current object that's calling this method. 22 00:01:28,150 --> 00:01:33,760 And what it's going to do is return every single field in that object within a string. 23 00:01:36,790 --> 00:01:38,500 Which then gets printed.