1 00:00:00,990 --> 00:00:03,180 Hope you're having fun building the Quidditch application. 2 00:00:04,980 --> 00:00:10,050 Our first task is to the necessary field to the team class, I obtained every field from requirements 3 00:00:10,260 --> 00:00:10,740 text. 4 00:00:12,370 --> 00:00:14,410 And they are private string house. 5 00:00:20,670 --> 00:00:22,110 Private string keeper. 6 00:00:27,510 --> 00:00:29,040 Private drink seeker. 7 00:00:33,100 --> 00:00:37,480 And private, an array of string chasers, because there are three chasers. 8 00:00:45,240 --> 00:00:49,260 And because there are four fields we need to add a constructor that receives four parameters. 9 00:01:05,770 --> 00:01:08,530 And then we'll update every field with a parameter value. 10 00:01:24,370 --> 00:01:29,170 And for a raise, remember to use a raised copy of to avoid the reference trap. 11 00:01:46,230 --> 00:01:50,340 OK, now we're going to copy constructor in case we need to create copies of a team object, which we 12 00:01:50,340 --> 00:01:51,300 most likely will. 13 00:01:56,030 --> 00:02:00,170 And instead of receiving values from a parameter, it's going to receive values from a source object. 14 00:02:18,280 --> 00:02:20,800 OK, now we can autocomplete the getters and setters. 15 00:02:28,400 --> 00:02:32,810 In this letter, we don't want to return a reference that points directly to the field will return a 16 00:02:32,810 --> 00:02:36,710 raised copy of that, copies every element from Chaser's. 17 00:02:40,660 --> 00:02:42,390 And we'll keep you the full length of the. 18 00:02:56,090 --> 00:03:00,620 OK, same thing in the center, remember to set the field equal to a copy of the outside variable. 19 00:03:17,940 --> 00:03:22,050 All right, the final task is not to string method, public string to string. 20 00:03:28,380 --> 00:03:30,570 We'll copy the format from the workbook article. 21 00:03:42,580 --> 00:03:48,580 OK, and it tells us the test our code by creating two objects of the team class, so copy that over 22 00:03:48,580 --> 00:03:49,090 and main. 23 00:04:23,190 --> 00:04:26,460 And your terminal should point to the folder Quidditch game. 24 00:04:31,360 --> 00:04:35,250 But Main Java is inside source slash maner. 25 00:04:38,930 --> 00:04:40,550 So you need to write Gervasi. 26 00:04:43,120 --> 00:04:46,390 Source slash, mean slash, mean java. 27 00:04:58,520 --> 00:05:03,650 We're basically telling the terminal, hey, the file we want to run is not inside the folder Quidditch 28 00:05:03,650 --> 00:05:03,980 game. 29 00:05:08,060 --> 00:05:11,030 You can compile me, not Java, by drilling into source. 30 00:05:17,120 --> 00:05:21,350 And we need to do the same thing for the Java command by telling the terminal where the file is that 31 00:05:21,350 --> 00:05:22,100 we want to run. 32 00:05:24,760 --> 00:05:29,730 OK, and printing an object should internally call its two string method and everything looks good now 33 00:05:29,740 --> 00:05:31,960 to see you in part two.