WEBVTT

1
00:00:05.100 --> 00:00:09.800
it

2
00:00:11.700 --> 00:00:12.900
<00:00:11.700>gutenmong <00:00:12.780>believe

3
00:00:14.400 --> 00:00:19.600
<00:00:14.400>sign, <00:00:15.800>it's

4
00:00:18.600 --> 00:00:20.300
<00:00:18.600>really <00:00:18.950>great <00:00:19.300>to <00:00:19.650>be <00:00:20.000>here.

5
00:00:21.200 --> 00:00:24.200
<00:00:21.200>And <00:00:21.355>I <00:00:21.511>think <00:00:21.666>it's <00:00:21.822>also <00:00:21.977>a <00:00:22.133>great <00:00:22.288>time <00:00:22.444>to <00:00:22.599>be

6
00:00:24.200 --> 00:00:25.400
<00:00:24.200>a <00:00:24.740>Java <00:00:25.279>developer.

7
00:00:26.400 --> 00:00:29.400
<00:00:26.400>Because <00:00:26.680>currently <00:00:26.959>Java <00:00:27.240>19 <00:00:27.520>is <00:00:27.799>being

8
00:00:29.400 --> 00:00:29.800
developed.

9
00:00:30.700 --> 00:00:33.100
<00:00:30.700>And <00:00:30.980>as <00:00:31.259>you <00:00:31.540>might <00:00:31.820>have <00:00:32.100>heard

10
00:00:33.100 --> 00:00:37.000
<00:00:33.100>with <00:00:33.227>for <00:00:33.354>the <00:00:33.481>first <00:00:33.609>time <00:00:33.736>going <00:00:33.863>to <00:00:33.990>see <00:00:34.118>things <00:00:34.245>from <00:00:34.372>Project <00:00:34.500>Loon

11
00:00:36.600 --> 00:00:39.600
<00:00:36.600>sneaking <00:00:36.880>into <00:00:37.160>the <00:00:37.440>language. <00:00:37.720>So <00:00:38.000>that

12
00:00:39.600 --> 00:00:42.900
<00:00:39.600>means <00:00:39.800>we <00:00:40.000>gonna <00:00:40.200>get <00:00:40.400>virtual <00:00:40.600>threats <00:00:40.800>and <00:00:41.000>structured

13
00:00:42.900 --> 00:00:45.200
<00:00:42.900>concurrency. <00:00:43.366>And <00:00:43.833>I <00:00:44.300>think

14
00:00:45.200 --> 00:00:48.200
<00:00:45.200>that's <00:00:45.327>going <00:00:45.454>to <00:00:45.581>be <00:00:45.709>amazing <00:00:45.836>for <00:00:45.963>Java <00:00:46.090>and <00:00:46.218>it's <00:00:46.345>really <00:00:46.472>going <00:00:46.600>to

15
00:00:48.200 --> 00:00:51.800
<00:00:48.200>change <00:00:48.400>the <00:00:48.600>way <00:00:48.800>we <00:00:49.000>look <00:00:49.200>at <00:00:49.400>concurrency <00:00:49.600>and

16
00:00:51.800 --> 00:00:53.900
<00:00:51.800>concurrent <00:00:52.266>programming <00:00:52.733>in <00:00:53.199>Java.

17
00:00:55.400 --> 00:00:57.400
<00:00:55.400>So <00:00:55.600>that's <00:00:55.800>really <00:00:56.000>something <00:00:56.199>to <00:00:56.400>look <00:00:56.600>forward <00:00:56.800>to.

18
00:00:58.500 --> 00:01:01.100
<00:00:58.500>But <00:00:58.780>that's <00:00:59.060>not <00:00:59.340>what <00:00:59.620>I'm <00:00:59.900>going

19
00:01:01.100 --> 00:01:04.200
<00:01:01.100>to <00:01:01.240>do <00:01:01.380>today <00:01:01.520>today. <00:01:01.660>I'm <00:01:01.800>going <00:01:01.940>to <00:01:02.080>look <00:01:02.220>back <00:01:02.360>and <00:01:02.500>I'm

20
00:01:04.200 --> 00:01:07.200
<00:01:04.200>gonna <00:01:04.375>look <00:01:04.550>back <00:01:04.725>at <00:01:04.900>language <00:01:05.075>features <00:01:05.250>that <00:01:05.425>have <00:01:05.600>been

21
00:01:07.200 --> 00:01:08.600
<00:01:07.200>added <00:01:07.830>to <00:01:08.460>Java.

22
00:01:09.300 --> 00:01:11.800
<00:01:09.300>Since <00:01:09.580>Java <00:01:09.860>12, <00:01:10.140>why <00:01:10.420>offer <00:01:10.700>12?

23
00:01:12.700 --> 00:01:15.500
<00:01:12.700>the <00:01:12.980>previous <00:01:13.260>long-term <00:01:13.540>support <00:01:13.820>version <00:01:14.100>of

24
00:01:15.500 --> 00:01:17.400
<00:01:15.500>java <00:01:16.200>was <00:01:16.900>11

25
00:01:18.300 --> 00:01:22.000
<00:01:18.300>which <00:01:18.500>was <00:01:18.700>replaced <00:01:18.899>September <00:01:19.100>last <00:01:19.300>year <00:01:19.500>with <00:01:19.700>Java

26
00:01:21.400 --> 00:01:24.900
<00:01:21.400>17, <00:01:21.633>which <00:01:21.866>is <00:01:22.100>the <00:01:22.333>current <00:01:22.566>long <00:01:22.800>term

27
00:01:24.900 --> 00:01:26.100
<00:01:24.900>support <00:01:25.979>version.

28
00:01:26.900 --> 00:01:30.100
<00:01:26.900>So <00:01:27.100>we're <00:01:27.300>going <00:01:27.500>to <00:01:27.700>look <00:01:27.900>at <00:01:28.100>five <00:01:28.300>different

29
00:01:29.100 --> 00:01:30.800
features.

30
00:01:32.400 --> 00:01:34.500
<00:01:32.400>Four <00:01:32.680>of <00:01:32.960>them <00:01:33.240>look <00:01:33.520>really <00:01:33.800>nice.

31
00:01:36.200 --> 00:01:39.400
<00:01:36.200>On <00:01:36.480>themselves, <00:01:36.760>but <00:01:37.040>when <00:01:37.320>used <00:01:37.600>together,

32
00:01:39.400 --> 00:01:42.400
<00:01:39.400>they <00:01:39.575>really <00:01:39.750>show <00:01:39.925>the <00:01:40.100>strength <00:01:40.275>and <00:01:40.450>the <00:01:40.625>ideas <00:01:40.800>of

33
00:01:42.400 --> 00:01:43.300
<00:01:42.400>the <00:01:42.805>language <00:01:43.210>Developers.

34
00:01:44.800 --> 00:01:47.300
<00:01:44.800>So <00:01:45.149>starting <00:01:45.500>with <00:01:45.850>the <00:01:46.200>switch

35
00:01:47.300 --> 00:01:50.600
<00:01:47.300>expression, <00:01:47.766>which <00:01:48.233>was <00:01:48.700>added

36
00:01:50.600 --> 00:01:53.600
<00:01:50.600>as <00:01:50.833>a <00:01:51.066>preview <00:01:51.300>future <00:01:51.533>in <00:01:51.766>Java <00:01:52.000>12.

37
00:01:54.900 --> 00:01:57.700
<00:01:54.900>And <00:01:55.250>then <00:01:55.600>became <00:01:55.950>Final <00:01:56.300>in

38
00:01:57.700 --> 00:01:58.400
14.

39
00:02:00.700 --> 00:02:00.800
so

40
00:02:01.800 --> 00:02:02.100
switch

41
00:02:03.200 --> 00:02:06.400
<00:02:03.200>has <00:02:03.340>always <00:02:03.480>been <00:02:03.620>part <00:02:03.760>of <00:02:03.900>the <00:02:04.040>Java <00:02:04.180>language <00:02:04.320>from <00:02:04.460>day <00:02:04.600>one.

42
00:02:06.400 --> 00:02:09.600
<00:02:06.400>We <00:02:06.633>had <00:02:06.866>the <00:02:07.100>switch <00:02:07.333>statement, <00:02:07.566>which <00:02:07.800>was

43
00:02:09.600 --> 00:02:12.500
<00:02:09.600>basically <00:02:09.833>similar <00:02:10.066>to <00:02:10.299>the <00:02:10.533>switch <00:02:10.766>statement <00:02:11.000>as

44
00:02:12.500 --> 00:02:15.900
<00:02:12.500>you <00:02:12.733>can <00:02:12.966>see <00:02:13.200>in <00:02:13.433>plain <00:02:13.666>CM <00:02:13.900>but

45
00:02:15.900 --> 00:02:18.000
<00:02:15.900>now <00:02:16.180>we <00:02:16.460>got <00:02:16.740>the <00:02:17.020>switch <00:02:17.300>expression.

46
00:02:19.200 --> 00:02:19.800
<00:02:19.200>and <00:02:19.740>basically

47
00:02:21.100 --> 00:02:24.100
<00:02:21.100>it's <00:02:21.275>kind <00:02:21.450>of <00:02:21.625>a <00:02:21.799>function <00:02:21.975>that <00:02:22.150>returns <00:02:22.325>a <00:02:22.500>value

48
00:02:24.100 --> 00:02:26.200
<00:02:24.100>so <00:02:24.333>it <00:02:24.566>looks <00:02:24.799>a <00:02:25.033>bit <00:02:25.266>like <00:02:25.500>this.

49
00:02:27.100 --> 00:02:28.900
<00:02:27.100>You <00:02:27.380>call <00:02:27.660>it <00:02:27.940>with <00:02:28.220>a <00:02:28.500>value.

50
00:02:32.100 --> 00:02:35.600
<00:02:32.100>And <00:02:32.275>then <00:02:32.450>we <00:02:32.625>have <00:02:32.799>to <00:02:32.975>typical <00:02:33.150>casting <00:02:33.325>only <00:02:33.500>now

51
00:02:35.600 --> 00:02:36.500
<00:02:35.600>we <00:02:35.870>have <00:02:36.140>an <00:02:36.410>arrow.

52
00:02:38.100 --> 00:02:41.400
<00:02:38.100>And <00:02:38.255>after <00:02:38.411>the <00:02:38.566>arrow, <00:02:38.722>there's <00:02:38.877>a <00:02:39.033>value <00:02:39.188>and <00:02:39.344>that's <00:02:39.500>it.

53
00:02:41.400 --> 00:02:44.800
<00:02:41.400>That's <00:02:41.600>the <00:02:41.800>one <00:02:42.000>statement <00:02:42.200>that <00:02:42.400>is <00:02:42.600>allowed. <00:02:42.800>There's

54
00:02:44.800 --> 00:02:47.200
<00:02:44.800>only <00:02:44.975>one <00:02:45.150>statement <00:02:45.325>allowed <00:02:45.500>unless <00:02:45.675>you <00:02:45.850>use <00:02:46.025>a <00:02:46.200>block

55
00:02:47.200 --> 00:02:50.700
<00:02:47.200>and <00:02:47.433>it <00:02:47.666>will <00:02:47.899>return <00:02:48.133>the <00:02:48.366>value <00:02:48.600>so

56
00:02:50.700 --> 00:02:52.800
<00:02:50.700>you <00:02:50.933>don't <00:02:51.166>need <00:02:51.399>to <00:02:51.633>return <00:02:51.866>statement <00:02:52.100>anymore.

57
00:02:54.600 --> 00:02:57.300
<00:02:54.600>So <00:02:54.799>that's <00:02:55.000>the <00:02:55.200>arrow. <00:02:55.400>That's <00:02:55.600>the <00:02:55.799>new <00:02:56.000>thing

58
00:02:57.300 --> 00:03:01.100
<00:02:57.300>and <00:02:57.500>then <00:02:57.700>it's <00:02:57.900>called <00:02:58.100>a <00:02:58.300>switch <00:02:58.500>labeled <00:02:58.700>rule.

59
00:03:02.200 --> 00:03:03.300
<00:03:02.200>And <00:03:02.398>there's <00:03:02.596>a <00:03:02.794>reason <00:03:02.992>for <00:03:03.190>that.

60
00:03:04.800 --> 00:03:06.100
<00:03:04.800>Of <00:03:04.995>course, <00:03:05.190>you <00:03:05.385>can <00:03:05.580>have <00:03:05.775>multiple <00:03:05.970>labels.

61
00:03:07.600 --> 00:03:10.200
<00:03:07.600>And <00:03:08.066>that's <00:03:08.533>one <00:03:09.000>thing

62
00:03:10.200 --> 00:03:13.500
<00:03:10.200>because <00:03:10.355>it's <00:03:10.511>kind <00:03:10.666>of <00:03:10.822>a <00:03:10.977>function. <00:03:11.133>It <00:03:11.288>Returns <00:03:11.444>the <00:03:11.600>value.

63
00:03:14.100 --> 00:03:17.700
<00:03:14.100>So <00:03:14.216>you <00:03:14.333>have <00:03:14.450>to <00:03:14.566>come <00:03:14.683>up <00:03:14.799>with <00:03:14.916>a <00:03:15.033>value <00:03:15.150>in <00:03:15.266>the <00:03:15.383>default <00:03:15.500>switch

64
00:03:17.700 --> 00:03:20.300
<00:03:17.700>you <00:03:17.855>don't <00:03:18.011>need <00:03:18.166>to <00:03:18.322>but <00:03:18.477>he <00:03:18.633>need <00:03:18.788>to <00:03:18.944>so <00:03:19.100>we

65
00:03:20.300 --> 00:03:23.500
<00:03:20.300>always <00:03:20.580>will <00:03:20.860>need <00:03:21.140>unless <00:03:21.420>your <00:03:21.700>exhaustive.

66
00:03:24.400 --> 00:03:27.400
<00:03:24.400>Meaning <00:03:24.555>you <00:03:24.711>have <00:03:24.866>for <00:03:25.022>instance <00:03:25.177>when <00:03:25.333>you <00:03:25.488>do <00:03:25.644>a <00:03:25.800>case

67
00:03:27.400 --> 00:03:28.300
<00:03:27.400>over <00:03:27.805>an <00:03:28.210>enumeration.

68
00:03:29.200 --> 00:03:32.200
<00:03:29.200>then <00:03:29.307>you <00:03:29.415>can <00:03:29.523>be <00:03:29.630>exhausted <00:03:29.738>because <00:03:29.846>you <00:03:29.953>want <00:03:30.061>to <00:03:30.169>all <00:03:30.276>the <00:03:30.384>possible <00:03:30.492>values <00:03:30.600>but

69
00:03:33.200 --> 00:03:35.100
<00:03:33.200>a <00:03:33.355>bit <00:03:33.511>harder <00:03:33.666>with <00:03:33.822>numbers <00:03:33.977>so <00:03:34.133>then <00:03:34.288>you <00:03:34.444>would <00:03:34.600>need

70
00:03:37.100 --> 00:03:38.000
<00:03:37.100>a <00:03:37.505>default <00:03:37.910>statement

71
00:03:40.900 --> 00:03:43.600
<00:03:40.900>but <00:03:41.040>we <00:03:41.180>didn't <00:03:41.320>get <00:03:41.460>one. <00:03:41.600>We <00:03:41.740>actually <00:03:41.880>got <00:03:42.020>two <00:03:42.160>versions <00:03:42.300>of

72
00:03:43.600 --> 00:03:46.500
<00:03:43.600>the <00:03:43.950>switch <00:03:44.299>expression <00:03:44.650>and <00:03:45.000>this

73
00:03:46.500 --> 00:03:49.500
<00:03:46.500>is <00:03:46.780>called <00:03:47.060>a <00:03:47.340>switched <00:03:47.620>labeled <00:03:47.900>statement

74
00:03:49.500 --> 00:03:50.000
group.

75
00:03:50.800 --> 00:03:54.100
<00:03:50.800>And <00:03:50.940>it <00:03:51.080>does <00:03:51.220>exactly <00:03:51.360>that <00:03:51.500>so <00:03:51.640>you <00:03:51.780>can <00:03:51.920>have <00:03:52.060>a <00:03:52.200>number

76
00:03:53.100 --> 00:03:55.300
<00:03:53.100>of <00:03:54.500>statements.

77
00:03:57.700 --> 00:04:00.500
<00:03:57.700>Still <00:03:57.933>with <00:03:58.166>the <00:03:58.399>cases <00:03:58.633>The <00:03:58.866>Cliffs <00:03:59.100>the

78
00:04:00.500 --> 00:04:03.200
<00:04:00.500>more <00:04:00.640>classical <00:04:00.780>type <00:04:00.920>you <00:04:01.060>can <00:04:01.200>have <00:04:01.340>multiple <00:04:01.480>statements <00:04:01.620>and <00:04:01.760>you <00:04:01.900>need

79
00:04:03.200 --> 00:04:06.200
<00:04:03.200>to <00:04:03.399>end <00:04:03.600>with <00:04:03.799>yield. <00:04:04.000>So <00:04:04.200>the <00:04:04.399>yield <00:04:04.600>is

80
00:04:06.200 --> 00:04:09.400
<00:04:06.200>basically <00:04:06.327>where <00:04:06.454>you're <00:04:06.581>saying. <00:04:06.709>Okay, <00:04:06.836>I <00:04:06.963>now <00:04:07.090>executed <00:04:07.218>a <00:04:07.345>number <00:04:07.472>of <00:04:07.600>statements.

81
00:04:09.400 --> 00:04:11.800
<00:04:09.400>This <00:04:09.575>is <00:04:09.750>the <00:04:09.925>value <00:04:10.100>I <00:04:10.275>would <00:04:10.450>like <00:04:10.625>to <00:04:10.800>return.

82
00:04:15.500 --> 00:04:18.200
<00:04:15.500>Well <00:04:15.700>on <00:04:15.900>its <00:04:16.100>own <00:04:16.300>again, <00:04:16.500>it <00:04:16.700>doesn't <00:04:16.899>look

83
00:04:18.200 --> 00:04:21.600
<00:04:18.200>very <00:04:18.339>very <00:04:18.479>fancy <00:04:18.620>and <00:04:18.760>not <00:04:18.899>much <00:04:19.039>of <00:04:19.180>an <00:04:19.320>enhancement <00:04:19.459>but <00:04:19.599>later

84
00:04:21.600 --> 00:04:24.300
<00:04:21.600>together <00:04:21.833>with <00:04:22.066>two <00:04:22.300>classes <00:04:22.533>and <00:04:22.766>Records, <00:04:23.000>we

85
00:04:24.300 --> 00:04:27.900
<00:04:24.300>will <00:04:24.440>and <00:04:24.580>also <00:04:24.720>pattern <00:04:24.860>matching. <00:04:25.000>In <00:04:25.140>fact, <00:04:25.280>we <00:04:25.420>will <00:04:25.560>see <00:04:25.700>that

86
00:04:27.900 --> 00:04:30.000
<00:04:27.900>it <00:04:28.179>can <00:04:28.460>actually <00:04:28.739>be <00:04:29.020>quite <00:04:29.299>useful.

87
00:04:32.800 --> 00:04:33.500
<00:04:32.800>the <00:04:33.115>next <00:04:33.430>thing

88
00:04:34.300 --> 00:04:36.100
<00:04:34.300>Is <00:04:35.000>text <00:04:35.700>blocks?

89
00:04:39.400 --> 00:04:42.800
<00:04:39.400>I <00:04:39.539>guess <00:04:39.679>we've <00:04:39.820>all <00:04:39.960>had <00:04:40.099>cold <00:04:40.239>like <00:04:40.380>this <00:04:40.520>before <00:04:40.659>you've <00:04:40.799>got

90
00:04:42.800 --> 00:04:45.300
<00:04:42.800>a <00:04:43.150>multiple <00:04:43.500>strings <00:04:43.850>and <00:04:44.200>you

91
00:04:45.300 --> 00:04:48.300
<00:04:45.300>need <00:04:45.475>to <00:04:45.650>concatenate <00:04:45.825>them <00:04:46.000>together. <00:04:46.175>So <00:04:46.350>you <00:04:46.525>got <00:04:46.700>all

92
00:04:48.300 --> 00:04:49.900
<00:04:48.300>these <00:04:49.000>pesky <00:04:49.700>pluses.

93
00:04:50.700 --> 00:04:53.400
<00:04:50.700>and <00:04:50.933>things <00:04:51.166>get <00:04:51.400>even <00:04:51.633>worse <00:04:51.866>if <00:04:52.099>you

94
00:04:55.100 --> 00:04:58.200
<00:04:55.100>have <00:04:55.240>quotations <00:04:55.380>because <00:04:55.520>then <00:04:55.660>you <00:04:55.800>need <00:04:55.940>to <00:04:56.080>escape <00:04:56.220>them. <00:04:56.360>That's <00:04:56.500>really

95
00:04:58.200 --> 00:04:58.500
really.

96
00:04:59.700 --> 00:05:02.900
<00:04:59.700>Annoying <00:04:59.900>It's <00:05:00.099>hard <00:05:00.300>to <00:05:00.500>read <00:05:00.700>it's <00:05:00.900>Eric <00:05:01.099>prone.

97
00:05:02.900 --> 00:05:04.100
<00:05:02.900>It's <00:05:03.116>really <00:05:03.332>not <00:05:03.548>what <00:05:03.764>you <00:05:03.980>want.

98
00:05:07.800 --> 00:05:10.200
<00:05:07.800>Um, <00:05:07.940>I <00:05:08.080>remember <00:05:08.220>being <00:05:08.360>on <00:05:08.500>a <00:05:08.640>project <00:05:08.780>some <00:05:08.920>10 <00:05:09.060>12 <00:05:09.200>years

99
00:05:10.200 --> 00:05:13.700
<00:05:10.200>ago <00:05:10.375>where <00:05:10.550>we <00:05:10.724>used <00:05:10.900>groovy <00:05:11.075>and <00:05:11.250>Grails <00:05:11.425>on <00:05:11.599>a

100
00:05:13.700 --> 00:05:14.000
jvm.

101
00:05:15.400 --> 00:05:17.900
<00:05:15.400>And <00:05:15.575>groovy <00:05:15.750>already <00:05:15.924>had <00:05:16.099>the <00:05:16.275>concept <00:05:16.450>of <00:05:16.625>text <00:05:16.799>blocks.

102
00:05:19.300 --> 00:05:22.600
<00:05:19.300>But <00:05:19.500>they <00:05:19.700>never <00:05:19.900>made <00:05:20.100>it <00:05:20.300>to <00:05:20.500>Java <00:05:20.700>yet.

103
00:05:23.800 --> 00:05:26.300
<00:05:23.800>And <00:05:24.266>and <00:05:24.733>sometimes <00:05:25.200>people

104
00:05:26.300 --> 00:05:31.100
<00:05:26.300>wonder <00:05:26.416>why <00:05:26.533>does <00:05:26.650>it <00:05:26.766>take <00:05:26.883>so <00:05:27.000>long <00:05:27.116>to <00:05:27.233>at <00:05:27.350>these <00:05:27.466>features <00:05:27.583>because <00:05:27.700>how

105
00:05:29.100 --> 00:05:31.900
<00:05:29.100>hard <00:05:29.566>can <00:05:30.033>it <00:05:30.500>be?

106
00:05:32.700 --> 00:05:34.300
<00:05:32.700>Well, <00:05:32.979>there <00:05:33.260>was <00:05:33.539>this <00:05:33.820>great <00:05:34.099>article.

107
00:05:35.600 --> 00:05:38.500
<00:05:35.600>From <00:05:35.740>one <00:05:35.880>of <00:05:36.020>the <00:05:36.160>language <00:05:36.300>architects <00:05:36.440>who <00:05:36.580>said <00:05:36.720>okay, <00:05:36.860>what <00:05:37.000>if

108
00:05:38.500 --> 00:05:41.200
<00:05:38.500>you <00:05:38.700>remove <00:05:38.900>the <00:05:39.100>semicolon <00:05:39.300>because <00:05:39.500>kotlin <00:05:39.700>came <00:05:39.900>and

109
00:05:41.200 --> 00:05:44.200
<00:05:41.200>it <00:05:41.300>didn't <00:05:41.400>need <00:05:41.500>a <00:05:41.599>semicolon. <00:05:41.700>So <00:05:41.800>we <00:05:41.900>thought <00:05:42.000>well, <00:05:42.099>why <00:05:42.200>do <00:05:42.300>we <00:05:42.400>still <00:05:42.500>need <00:05:42.599>it

110
00:05:44.200 --> 00:05:46.700
<00:05:44.200>in <00:05:44.433>Java <00:05:44.666>then <00:05:44.900>and <00:05:45.133>then <00:05:45.366>he <00:05:45.599>listed.

111
00:05:47.600 --> 00:05:50.300
<00:05:47.600>How <00:05:47.950>many <00:05:48.300>impact <00:05:48.650>it <00:05:49.000>would

112
00:05:50.300 --> 00:05:53.600
<00:05:50.300>have <00:05:50.500>on <00:05:50.700>the <00:05:50.900>compiler <00:05:51.100>just <00:05:51.300>removing <00:05:51.500>the <00:05:51.700>semicolon?

113
00:05:55.600 --> 00:05:59.200
<00:05:55.600>So <00:05:55.833>I <00:05:56.066>guess <00:05:56.300>we <00:05:56.533>sometimes <00:05:56.766>underestimate <00:05:57.000>what

114
00:05:58.200 --> 00:06:01.400
<00:05:58.200>a <00:05:58.479>huge <00:05:58.760>Beast. <00:05:59.039>The <00:05:59.320>Java <00:05:59.599>compiler

115
00:06:01.400 --> 00:06:04.500
<00:06:01.400>has <00:06:01.633>become <00:06:01.866>and <00:06:02.099>that <00:06:02.333>certain <00:06:02.566>features <00:06:02.799>really

116
00:06:04.500 --> 00:06:05.200
<00:06:04.500>take <00:06:04.710>a <00:06:04.920>long <00:06:05.130>time.

117
00:06:06.700 --> 00:06:09.100
<00:06:06.700>But <00:06:06.875>we <00:06:07.050>shouldn't <00:06:07.224>dwell <00:06:07.400>on <00:06:07.575>it. <00:06:07.750>We <00:06:07.925>now <00:06:08.099>have

118
00:06:10.200 --> 00:06:13.800
<00:06:10.200>text <00:06:10.355>blocks <00:06:10.511>and <00:06:10.666>then <00:06:10.822>suddenly <00:06:10.977>you <00:06:11.133>can <00:06:11.288>write <00:06:11.444>the <00:06:11.599>same

119
00:06:13.800 --> 00:06:16.600
<00:06:13.800>statement <00:06:13.975>in <00:06:14.150>this <00:06:14.325>way <00:06:14.500>you <00:06:14.675>start <00:06:14.850>with <00:06:15.025>triple <00:06:15.200>quotes

120
00:06:16.600 --> 00:06:19.400
<00:06:16.600>and <00:06:16.800>then <00:06:17.000>you <00:06:17.200>just <00:06:17.400>write <00:06:17.600>the <00:06:17.800>text <00:06:18.000>as

121
00:06:19.400 --> 00:06:20.200
<00:06:19.400>you <00:06:19.580>want <00:06:19.760>it <00:06:19.940>to <00:06:20.120>be.

122
00:06:23.200 --> 00:06:26.200
<00:06:23.200>And <00:06:23.355>so <00:06:23.511>the <00:06:23.666>triple <00:06:23.822>quotes <00:06:23.977>there <00:06:24.133>and <00:06:24.288>here <00:06:24.444>you <00:06:24.599>can

123
00:06:26.200 --> 00:06:29.500
<00:06:26.200>even <00:06:26.400>use <00:06:26.599>quotes <00:06:26.800>within <00:06:27.000>the <00:06:27.200>text. <00:06:27.400>So <00:06:27.599>no

124
00:06:29.500 --> 00:06:30.800
<00:06:29.500>more <00:06:30.085>escaping <00:06:30.670>needed.

125
00:06:32.700 --> 00:06:35.700
<00:06:32.700>So <00:06:32.933>much <00:06:33.166>more <00:06:33.400>readable <00:06:33.633>and <00:06:33.866>much <00:06:34.099>nicer

126
00:06:35.700 --> 00:06:36.100
<00:06:35.700>I <00:06:36.060>think.

127
00:06:37.100 --> 00:06:39.000
<00:06:37.100>Few <00:06:37.300>things <00:06:37.500>we <00:06:37.700>need <00:06:37.900>to <00:06:38.100>take <00:06:38.300>care <00:06:38.500>of.

128
00:06:40.100 --> 00:06:40.400
this

129
00:06:41.700 --> 00:06:42.500
<00:06:41.700>is <00:06:42.420>what?

130
00:06:43.600 --> 00:06:46.300
<00:06:43.600>Java <00:06:43.950>course <00:06:44.300>unintentional <00:06:44.650>white <00:06:45.000>space

131
00:06:46.300 --> 00:06:49.300
<00:06:46.300>because <00:06:46.475>you <00:06:46.650>never <00:06:46.825>intended <00:06:47.000>those <00:06:47.175>spaces <00:06:47.350>to <00:06:47.525>be <00:06:47.700>there

132
00:06:49.300 --> 00:06:52.900
<00:06:49.300>and <00:06:49.475>and <00:06:49.650>the <00:06:49.825>spaces <00:06:50.000>in <00:06:50.175>front <00:06:50.350>of <00:06:50.525>the <00:06:50.700>from

133
00:06:52.900 --> 00:06:55.200
<00:06:52.900>keyword. <00:06:53.133>You <00:06:53.366>don't <00:06:53.599>really <00:06:53.833>want <00:06:54.066>them <00:06:54.299>there.

134
00:06:55.200 --> 00:06:58.700
<00:06:55.200>You <00:06:55.327>don't <00:06:55.454>want <00:06:55.581>them <00:06:55.709>in <00:06:55.836>a <00:06:55.963>resulting <00:06:56.090>string. <00:06:56.218>So <00:06:56.345>what <00:06:56.472>the <00:06:56.599>compiler

135
00:06:58.700 --> 00:06:59.300
<00:06:58.700>will <00:06:58.970>actually <00:06:59.240>do.

136
00:07:00.200 --> 00:07:04.500
<00:07:00.200>Is <00:07:00.316>move <00:07:00.433>the <00:07:00.550>first <00:07:00.666>line <00:07:00.783>all <00:07:00.900>the <00:07:01.016>way <00:07:01.133>to <00:07:01.250>the <00:07:01.366>left <00:07:01.483>and <00:07:01.599>extract

137
00:07:03.500 --> 00:07:06.200
<00:07:03.500>all <00:07:03.850>the <00:07:04.200>white <00:07:04.550>space <00:07:04.900>from

138
00:07:06.200 --> 00:07:06.400
there.

139
00:07:08.200 --> 00:07:11.900
<00:07:08.200>Then <00:07:08.355>there's <00:07:08.511>also <00:07:08.666>the <00:07:08.822>thing <00:07:08.977>as <00:07:09.133>known <00:07:09.288>as <00:07:09.444>intentional <00:07:09.599>white

140
00:07:11.900 --> 00:07:13.000
<00:07:11.900>space, <00:07:12.229>which <00:07:12.560>is <00:07:12.890>this.

141
00:07:13.800 --> 00:07:17.200
<00:07:13.800>Because <00:07:13.975>here <00:07:14.150>the <00:07:14.325>compilers <00:07:14.500>are <00:07:14.675>always <00:07:14.850>you <00:07:15.025>really <00:07:15.200>indent

142
00:07:16.200 --> 00:07:18.300
<00:07:16.200>this <00:07:16.550>part <00:07:16.900>of <00:07:17.250>the <00:07:17.599>text.

143
00:07:19.200 --> 00:07:20.500
<00:07:19.200>So <00:07:19.433>we <00:07:19.668>need <00:07:19.902>to <00:07:20.136>keep <00:07:20.370>that.

144
00:07:22.200 --> 00:07:25.500
<00:07:22.200>For <00:07:22.400>the <00:07:22.599>rest <00:07:22.800>multiline <00:07:23.000>strings <00:07:23.200>or <00:07:23.400>text <00:07:23.599>blocks

145
00:07:25.500 --> 00:07:28.300
<00:07:25.500>or <00:07:25.640>however <00:07:25.780>you <00:07:25.920>want <00:07:26.060>to <00:07:26.200>call <00:07:26.340>them. <00:07:26.480>They're <00:07:26.620>just <00:07:26.760>regular <00:07:26.900>text

146
00:07:28.300 --> 00:07:30.300
<00:07:28.300>just <00:07:29.000>regular <00:07:29.700>strings.

147
00:07:31.100 --> 00:07:34.500
<00:07:31.100>So <00:07:31.216>you <00:07:31.333>can <00:07:31.450>perform <00:07:31.566>any <00:07:31.683>of <00:07:31.800>the <00:07:31.916>string <00:07:32.033>functions <00:07:32.150>can <00:07:32.266>be <00:07:32.383>executed <00:07:32.500>on

148
00:07:34.500 --> 00:07:37.400
<00:07:34.500>them. <00:07:34.733>Actually. <00:07:34.966>It's <00:07:35.200>only <00:07:35.433>a <00:07:35.666>compile <00:07:35.900>time

149
00:07:37.400 --> 00:07:40.600
<00:07:37.400>thing. <00:07:37.555>Once <00:07:37.711>we <00:07:37.866>had <00:07:38.022>runtime. <00:07:38.177>It's <00:07:38.333>just <00:07:38.488>an <00:07:38.644>ordinary <00:07:38.799>string

150
00:07:40.600 --> 00:07:41.400
<00:07:40.600>like <00:07:40.960>any <00:07:41.320>other.

151
00:07:46.300 --> 00:07:47.100
records

152
00:07:48.200 --> 00:07:50.200
<00:07:48.200>That's <00:07:48.375>the <00:07:48.550>third <00:07:48.724>thing. <00:07:48.900>We're <00:07:49.075>going <00:07:49.250>to <00:07:49.425>look <00:07:49.599>at.

153
00:07:51.100 --> 00:07:55.100
<00:07:51.100>Records <00:07:51.333>are <00:07:51.566>probably <00:07:51.800>the <00:07:52.033>most <00:07:52.266>discussed <00:07:52.500>and

154
00:07:54.100 --> 00:07:58.600
<00:07:54.100>later <00:07:54.450>most <00:07:54.800>loved <00:07:55.150>feature <00:07:55.500>that

155
00:07:57.600 --> 00:08:00.200
<00:07:57.600>was <00:07:57.880>added <00:07:58.160>to <00:07:58.440>the <00:07:58.720>Java <00:07:59.000>language.

156
00:08:01.500 --> 00:08:04.600
<00:08:01.500>So <00:08:01.700>it <00:08:01.900>had <00:08:02.100>its <00:08:02.300>preview <00:08:02.500>feature <00:08:02.700>in <00:08:02.900>Java

157
00:08:04.600 --> 00:08:07.800
<00:08:04.600>14. <00:08:04.755>Some <00:08:04.911>changes <00:08:05.066>were <00:08:05.222>applied <00:08:05.377>and <00:08:05.533>it <00:08:05.688>became <00:08:05.844>Final <00:08:06.000>in

158
00:08:07.800 --> 00:08:08.200
16.

159
00:08:10.100 --> 00:08:10.200
and

160
00:08:12.700 --> 00:08:15.300
<00:08:12.700>this <00:08:12.900>is <00:08:13.099>what <00:08:13.300>a <00:08:13.500>record <00:08:13.700>basically <00:08:13.900>looks <00:08:14.099>like.

161
00:08:16.300 --> 00:08:19.500
<00:08:16.300>You <00:08:16.500>specify <00:08:16.700>public <00:08:16.900>record <00:08:17.100>and <00:08:17.300>then <00:08:17.500>you <00:08:17.700>specify

162
00:08:19.500 --> 00:08:23.000
<00:08:19.500>all <00:08:19.733>the <00:08:19.966>name <00:08:20.200>of <00:08:20.433>the <00:08:20.666>instance <00:08:20.900>variables.

163
00:08:24.400 --> 00:08:27.200
<00:08:24.400>And <00:08:24.575>when <00:08:24.750>I <00:08:24.924>say <00:08:25.099>instance <00:08:25.275>variables, <00:08:25.450>there's <00:08:25.625>not <00:08:25.799>really

164
00:08:27.200 --> 00:08:31.700
<00:08:27.200>true <00:08:27.400>that <00:08:27.599>actually <00:08:27.800>final <00:08:28.000>instance <00:08:28.200>variables <00:08:28.400>meaning <00:08:28.599>once

165
00:08:30.700 --> 00:08:33.400
<00:08:30.700>the <00:08:31.166>Constructor <00:08:31.633>is <00:08:32.100>completed

166
00:08:33.400 --> 00:08:36.300
<00:08:33.400>and <00:08:33.574>they <00:08:33.750>will <00:08:33.924>have <00:08:34.100>their <00:08:34.275>final <00:08:34.449>value <00:08:34.625>and <00:08:34.799>from

167
00:08:36.300 --> 00:08:37.700
<00:08:36.299>then <00:08:36.720>on <00:08:37.140>our <00:08:37.560>immutable.

168
00:08:39.400 --> 00:08:42.300
<00:08:39.400>Um, <00:08:39.633>but <00:08:39.866>you <00:08:40.100>specify <00:08:40.333>everything <00:08:40.566>in <00:08:40.799>this

169
00:08:42.300 --> 00:08:45.600
<00:08:42.299>one <00:08:42.533>line <00:08:42.766>here. <00:08:43.000>So <00:08:43.233>you <00:08:43.466>specify <00:08:43.699>what

170
00:08:45.600 --> 00:08:48.100
<00:08:45.600>are <00:08:45.775>the <00:08:45.950>instance <00:08:46.125>variables? <00:08:46.300>What <00:08:46.475>are <00:08:46.650>the <00:08:46.825>names <00:08:47.000>and

171
00:08:48.100 --> 00:08:49.700
<00:08:48.100>which <00:08:48.566>type <00:08:49.033>they <00:08:49.500>are?

172
00:08:52.600 --> 00:08:55.600
<00:08:52.600>What <00:08:52.755>the <00:08:52.911>compiler <00:08:53.066>then <00:08:53.222>does <00:08:53.377>for <00:08:53.533>you <00:08:53.688>is <00:08:53.844>generate <00:08:54.000>a

173
00:08:55.600 --> 00:08:56.300
<00:08:55.600>bunch <00:08:55.915>of <00:08:56.230>code.

174
00:08:57.100 --> 00:09:00.200
<00:08:57.100>It <00:08:57.227>will <00:08:57.354>generate <00:08:57.481>the <00:08:57.609>equals <00:08:57.736>method. <00:08:57.863>If <00:08:57.990>you <00:08:58.118>want <00:08:58.245>to <00:08:58.372>do <00:08:58.500>some

175
00:09:00.200 --> 00:09:03.400
<00:09:00.200>comparison <00:09:00.375>with <00:09:00.550>them, <00:09:00.725>it <00:09:00.900>will <00:09:01.075>generate <00:09:01.250>the <00:09:01.425>hash <00:09:01.600>code

176
00:09:03.400 --> 00:09:06.200
<00:09:03.400>if <00:09:03.527>you <00:09:03.654>want <00:09:03.781>to <00:09:03.909>use <00:09:04.036>them <00:09:04.163>in <00:09:04.290>collections <00:09:04.418>it <00:09:04.545>will <00:09:04.672>of <00:09:04.800>course

177
00:09:06.200 --> 00:09:09.200
<00:09:06.200>generate <00:09:06.375>the <00:09:06.550>two <00:09:06.725>string <00:09:06.900>for <00:09:07.075>you <00:09:07.250>and <00:09:07.425>it <00:09:07.600>will

178
00:09:09.200 --> 00:09:12.400
<00:09:09.200>generate <00:09:09.375>what <00:09:09.550>we <00:09:09.725>used <00:09:09.900>to <00:09:10.075>call <00:09:10.250>the <00:09:10.425>getter <00:09:10.600>meters,

179
00:09:12.400 --> 00:09:15.400
<00:09:12.400>but <00:09:12.600>it's <00:09:12.800>a <00:09:13.000>bit <00:09:13.199>different <00:09:13.400>with <00:09:13.600>records <00:09:13.800>no

180
00:09:15.400 --> 00:09:17.400
<00:09:15.400>more <00:09:15.680>guesses <00:09:15.959>and <00:09:16.240>certainly <00:09:16.520>no <00:09:16.800>status.

181
00:09:18.700 --> 00:09:21.000
<00:09:18.700>Um, <00:09:18.900>so <00:09:19.100>let's <00:09:19.300>call <00:09:19.500>them <00:09:19.700>the <00:09:19.900>excessive <00:09:20.100>message.

182
00:09:22.600 --> 00:09:25.700
<00:09:22.600>Basically, <00:09:22.880>it <00:09:23.160>would <00:09:23.440>generate <00:09:23.720>this <00:09:24.000>piece

183
00:09:25.700 --> 00:09:26.600
<00:09:25.700>of <00:09:25.970>code <00:09:26.240>for <00:09:26.510>you.

184
00:09:31.900 --> 00:09:34.200
<00:09:31.900>Like <00:09:32.074>I <00:09:32.250>said <00:09:32.425>no <00:09:32.600>more <00:09:32.775>get <00:09:32.949>a <00:09:33.125>message. <00:09:33.300>So

185
00:09:34.200 --> 00:09:37.500
<00:09:34.200>it's <00:09:34.355>a <00:09:34.511>bit <00:09:34.666>different <00:09:34.822>here. <00:09:34.977>We <00:09:35.133>have <00:09:35.288>the <00:09:35.444>conference <00:09:35.600>record

186
00:09:37.500 --> 00:09:40.400
<00:09:37.500>with <00:09:37.780>a <00:09:38.060>location <00:09:38.340>variable <00:09:38.620>and <00:09:38.900>to

187
00:09:40.400 --> 00:09:43.300
<00:09:40.400>access <00:09:40.600>the <00:09:40.800>that <00:09:41.000>variable <00:09:41.199>you <00:09:41.400>just <00:09:41.600>use <00:09:41.800>it

188
00:09:43.300 --> 00:09:44.100
<00:09:43.300>as <00:09:43.540>the <00:09:43.780>same <00:09:44.020>name.

189
00:09:45.300 --> 00:09:48.800
<00:09:45.300>So <00:09:45.500>no <00:09:45.699>more <00:09:45.900>get <00:09:46.099>location <00:09:46.300>or <00:09:46.500>get <00:09:46.699>date,

190
00:09:48.800 --> 00:09:50.200
<00:09:48.800>but <00:09:49.052>you <00:09:49.304>use <00:09:49.556>it <00:09:49.808>like <00:09:50.060>this.

191
00:09:53.400 --> 00:09:54.800
<00:09:53.400>Creating <00:09:53.714>is <00:09:54.030>the <00:09:54.344>same <00:09:54.660>thing.

192
00:09:56.800 --> 00:09:59.300
<00:09:56.800>SFS <00:09:57.266>all <00:09:57.733>the <00:09:58.199>instance

193
00:09:59.300 --> 00:10:01.200
<00:09:59.300>variables <00:10:00.000>are <00:10:00.699>final.

194
00:10:02.800 --> 00:10:06.400
<00:10:02.800>You <00:10:03.033>have <00:10:03.266>to <00:10:03.500>provide <00:10:03.733>the <00:10:03.966>values <00:10:04.199>at

195
00:10:05.400 --> 00:10:08.700
<00:10:05.400>the <00:10:05.680>moment <00:10:05.959>of <00:10:06.240>construction. <00:10:06.520>So <00:10:06.800>you

196
00:10:08.700 --> 00:10:10.900
<00:10:08.700>have <00:10:09.050>an <00:10:09.400>all <00:10:09.750>arguments <00:10:10.100>Constructor.

197
00:10:12.500 --> 00:10:14.100
<00:10:12.500>That's <00:10:13.200>very <00:10:13.900>nice.

198
00:10:15.100 --> 00:10:18.000
<00:10:15.100>But <00:10:15.255>sometimes <00:10:15.411>maybe <00:10:15.566>you <00:10:15.722>want <00:10:15.877>to <00:10:16.033>do <00:10:16.188>some <00:10:16.344>extra <00:10:16.500>validation.

199
00:10:18.900 --> 00:10:21.200
<00:10:18.900>So <00:10:19.180>we <00:10:19.459>have <00:10:19.740>something <00:10:20.020>what <00:10:20.300>is

200
00:10:21.200 --> 00:10:23.000
<00:10:21.200>called <00:10:21.666>a <00:10:22.133>compact <00:10:22.600>Constructor?

201
00:10:23.800 --> 00:10:26.200
<00:10:23.800>Which <00:10:24.079>is <00:10:24.359>what <00:10:24.640>we <00:10:24.920>see <00:10:25.199>here.

202
00:10:27.500 --> 00:10:27.700
and

203
00:10:28.600 --> 00:10:31.200
<00:10:28.600>Basically, <00:10:28.740>what <00:10:28.880>you <00:10:29.020>do <00:10:29.160>in <00:10:29.300>there <00:10:29.440>is <00:10:29.580>say <00:10:29.720>okay. <00:10:29.860>This <00:10:30.000>is

204
00:10:31.200 --> 00:10:34.600
<00:10:31.200>a <00:10:31.355>cook. <00:10:31.511>I'm <00:10:31.666>still <00:10:31.822>having <00:10:31.977>a <00:10:32.133>Constructor <00:10:32.288>but <00:10:32.444>the <00:10:32.600>compiler

205
00:10:34.600 --> 00:10:37.100
<00:10:34.600>says <00:10:34.950>listenmate <00:10:35.300>you <00:10:35.650>don't <00:10:36.000>have

206
00:10:37.100 --> 00:10:40.300
<00:10:37.100>to <00:10:37.240>tell <00:10:37.380>me <00:10:37.520>which <00:10:37.660>variables <00:10:37.800>you're <00:10:37.940>going <00:10:38.080>to <00:10:38.220>pass <00:10:38.360>or <00:10:38.500>which

207
00:10:40.300 --> 00:10:43.900
<00:10:40.300>parameters <00:10:40.439>you're <00:10:40.579>going <00:10:40.719>to <00:10:40.859>pass <00:10:41.000>to <00:10:41.140>the <00:10:41.280>Constructor <00:10:41.420>because <00:10:41.560>I <00:10:41.699>already

208
00:10:43.900 --> 00:10:46.300
<00:10:43.900>know <00:10:44.027>it's <00:10:44.154>going <00:10:44.281>to <00:10:44.409>be <00:10:44.536>all <00:10:44.663>of <00:10:44.790>them. <00:10:44.918>So <00:10:45.045>don't <00:10:45.172>even <00:10:45.300>tell

209
00:10:46.300 --> 00:10:49.200
<00:10:46.300>me <00:10:46.500>I'll <00:10:46.699>pass <00:10:46.900>them <00:10:47.099>for <00:10:47.300>you. <00:10:47.500>So <00:10:47.699>here

210
00:10:49.200 --> 00:10:50.500
<00:10:49.200>I <00:10:49.785>can <00:10:50.370>access.

211
00:10:51.600 --> 00:10:54.500
<00:10:51.600>Even <00:10:51.755>though <00:10:51.911>I <00:10:52.066>didn't <00:10:52.222>specify <00:10:52.377>anything <00:10:52.533>I <00:10:52.688>can <00:10:52.844>see <00:10:53.000>event

212
00:10:54.500 --> 00:10:56.100
<00:10:54.500>name <00:10:54.966>here <00:10:55.433>and <00:10:55.900>this.

213
00:10:57.600 --> 00:11:00.700
<00:10:57.600>Is <00:10:57.775>the <00:10:57.950>parameter <00:10:58.125>it's <00:10:58.300>actually <00:10:58.475>not <00:10:58.650>the <00:10:58.825>instance <00:10:59.000>variable.

214
00:11:00.700 --> 00:11:01.500
<00:11:00.700>It's <00:11:01.060>the <00:11:01.420>parameter.

215
00:11:02.200 --> 00:11:06.000
<00:11:02.200>You <00:11:02.307>can <00:11:02.415>change <00:11:02.523>whatever <00:11:02.630>you <00:11:02.738>want <00:11:02.846>and <00:11:02.953>at <00:11:03.061>the <00:11:03.169>end <00:11:03.276>of <00:11:03.384>The <00:11:03.492>Constructor, <00:11:03.600>which

216
00:11:05.400 --> 00:11:08.600
<00:11:05.400>we <00:11:05.633>can't <00:11:05.866>see <00:11:06.100>because <00:11:06.333>again <00:11:06.566>the <00:11:06.800>compiler

217
00:11:08.600 --> 00:11:09.500
<00:11:08.600>inserts <00:11:09.005>the <00:11:09.410>code.

218
00:11:10.600 --> 00:11:13.900
<00:11:10.600>It <00:11:10.755>will <00:11:10.911>then <00:11:11.066>assign <00:11:11.222>these <00:11:11.377>parameters <00:11:11.533>to <00:11:11.688>the <00:11:11.844>actual <00:11:12.000>instance

219
00:11:13.900 --> 00:11:16.400
<00:11:13.900>variables. <00:11:14.133>So <00:11:14.366>this <00:11:14.600>is <00:11:14.833>your <00:11:15.066>perfect <00:11:15.300>place.

220
00:11:18.700 --> 00:11:22.400
<00:11:18.700>to <00:11:19.050>perform <00:11:19.400>validations <00:11:19.750>on <00:11:20.100>on

221
00:11:21.400 --> 00:11:24.300
<00:11:21.400>the <00:11:21.750>construction <00:11:22.100>of <00:11:22.449>your <00:11:22.800>record

222
00:11:26.200 --> 00:11:29.300
<00:11:26.200>and <00:11:26.375>that's <00:11:26.550>quite <00:11:26.725>an <00:11:26.900>important <00:11:27.075>thing <00:11:27.250>because <00:11:27.425>records <00:11:27.600>are

223
00:11:29.300 --> 00:11:32.100
<00:11:29.300>not <00:11:29.579>just <00:11:29.859>about <00:11:30.140>being <00:11:30.420>data <00:11:30.699>carriers.

224
00:11:33.300 --> 00:11:36.800
<00:11:33.300>Of <00:11:33.500>course, <00:11:33.699>that's <00:11:33.900>the <00:11:34.099>main <00:11:34.300>thing <00:11:34.500>you <00:11:34.699>just

225
00:11:36.800 --> 00:11:39.600
<00:11:36.800>want <00:11:36.955>to <00:11:37.111>have <00:11:37.266>some <00:11:37.422>kind <00:11:37.577>of <00:11:37.733>data <00:11:37.888>holder <00:11:38.044>and <00:11:38.199>Records.

226
00:11:40.200 --> 00:11:43.400
<00:11:40.200>Provide <00:11:40.480>very <00:11:40.760>short <00:11:41.040>way <00:11:41.320>of <00:11:41.600>doing

227
00:11:43.400 --> 00:11:46.800
<00:11:43.400>that <00:11:43.680>but <00:11:43.959>it's <00:11:44.240>also <00:11:44.520>about <00:11:44.800>security.

228
00:11:48.100 --> 00:11:52.300
<00:11:48.100>Imagine <00:11:48.275>you <00:11:48.450>have <00:11:48.625>a <00:11:48.800>restful <00:11:48.975>API <00:11:49.150>and <00:11:49.325>it <00:11:49.500>has

229
00:11:51.300 --> 00:11:54.200
<00:11:51.300>a <00:11:51.500>post <00:11:51.699>method <00:11:51.900>with <00:11:52.099>the <00:11:52.300>payload, <00:11:52.500>which <00:11:52.699>is

230
00:11:54.200 --> 00:11:54.900
<00:11:54.200>some <00:11:54.829>Jason.

231
00:11:55.900 --> 00:11:56.100
and

232
00:11:58.100 --> 00:12:01.100
<00:11:58.100>the <00:11:58.255>Jason <00:11:58.411>needs <00:11:58.566>to <00:11:58.722>be <00:11:58.877>DC <00:11:59.033>realized <00:11:59.188>in <00:11:59.344>some <00:11:59.500>kind

233
00:12:01.100 --> 00:12:03.400
<00:12:01.100>of <00:12:01.255>an <00:12:01.411>object. <00:12:01.566>So <00:12:01.722>your <00:12:01.877>application <00:12:02.033>can <00:12:02.188>work <00:12:02.344>with <00:12:02.500>it.

234
00:12:04.200 --> 00:12:07.300
<00:12:04.200>Well, <00:12:04.400>normally <00:12:04.600>if <00:12:04.800>you <00:12:05.000>would <00:12:05.200>use <00:12:05.400>libraries <00:12:05.600>like

235
00:12:07.300 --> 00:12:08.700
<00:12:07.300>Jackson <00:12:07.930>or <00:12:08.560>Jason

236
00:12:09.700 --> 00:12:12.900
<00:12:09.700>What <00:12:09.875>it <00:12:10.050>will <00:12:10.225>probably <00:12:10.400>do <00:12:10.575>is <00:12:10.750>either <00:12:10.925>call <00:12:11.100>your

237
00:12:12.900 --> 00:12:15.400
<00:12:12.900>class <00:12:13.133>new <00:12:13.366>instance <00:12:13.600>or <00:12:13.833>it <00:12:14.066>will <00:12:14.300>call.

238
00:12:17.100 --> 00:12:18.800
<00:12:17.100>the <00:12:17.450>default <00:12:17.800>no <00:12:18.150>Arc <00:12:18.500>Constructor

239
00:12:19.700 --> 00:12:22.200
<00:12:19.700>Then <00:12:19.933>it <00:12:20.166>will <00:12:20.400>come <00:12:20.633>across <00:12:20.866>and <00:12:21.100>see.

240
00:12:22.200 --> 00:12:26.400
<00:12:22.200>Oh, <00:12:22.355>there's <00:12:22.511>an <00:12:22.666>event <00:12:22.822>name <00:12:22.977>somewhere <00:12:23.133>in <00:12:23.288>my <00:12:23.444>Json <00:12:23.600>and

241
00:12:25.400 --> 00:12:29.100
<00:12:25.400>I've <00:12:25.600>got <00:12:25.800>an <00:12:26.000>event <00:12:26.199>method <00:12:26.400>so <00:12:26.600>it'll <00:12:26.800>probably

242
00:12:29.100 --> 00:12:32.100
<00:12:29.100>use <00:12:29.450>reflection <00:12:29.800>to <00:12:30.150>set <00:12:30.500>the

243
00:12:32.100 --> 00:12:32.400
value.

244
00:12:33.100 --> 00:12:36.400
<00:12:33.100>Meaning <00:12:33.275>it <00:12:33.450>will <00:12:33.625>set <00:12:33.800>the <00:12:33.975>field <00:12:34.150>directly. <00:12:34.325>Thus <00:12:34.500>possibly

245
00:12:36.400 --> 00:12:39.500
<00:12:36.400>bypassing <00:12:36.866>any <00:12:37.333>validations <00:12:37.800>you

246
00:12:39.500 --> 00:12:41.000
<00:12:39.500>might <00:12:39.837>have <00:12:40.175>in <00:12:40.512>your <00:12:40.850>Constructor.

247
00:12:41.900 --> 00:12:44.200
<00:12:41.900>Or <00:12:42.133>in <00:12:42.366>your <00:12:42.600>settings <00:12:42.833>if <00:12:43.066>we <00:12:43.300>talking

248
00:12:44.200 --> 00:12:45.600
<00:12:44.200>about <00:12:44.515>a <00:12:44.830>normal <00:12:45.145>Java <00:12:45.460>class.

249
00:12:47.400 --> 00:12:48.500
<00:12:47.400>Now <00:12:48.390>when?

250
00:12:50.800 --> 00:12:54.500
<00:12:50.800>With <00:12:51.033>records <00:12:51.266>that <00:12:51.500>won't <00:12:51.733>do <00:12:51.966>because <00:12:52.199>we

251
00:12:53.500 --> 00:12:56.200
<00:12:53.500>don't <00:12:53.850>have <00:12:54.200>a <00:12:54.550>zero <00:12:54.900>R

252
00:12:56.200 --> 00:13:00.100
<00:12:56.200>Constructor. <00:12:56.355>We <00:12:56.511>only <00:12:56.666>have <00:12:56.822>the <00:12:56.977>old <00:12:57.133>Arc <00:12:57.288>Constructors <00:12:57.444>and <00:12:57.600>if

253
00:12:59.100 --> 00:13:01.500
<00:12:59.100>you <00:12:59.450>try <00:12:59.800>to <00:13:00.150>use <00:13:00.500>reflection

254
00:13:02.400 --> 00:13:05.400
<00:13:02.400>On <00:13:02.574>records <00:13:02.750>you'll <00:13:02.925>get <00:13:03.100>an <00:13:03.275>illegal <00:13:03.449>access <00:13:03.625>method. <00:13:03.800>So

255
00:13:05.400 --> 00:13:08.600
<00:13:05.400>the <00:13:05.527>only <00:13:05.654>way <00:13:05.781>to <00:13:05.909>create <00:13:06.036>a <00:13:06.163>record <00:13:06.290>is <00:13:06.418>file <00:13:06.545>a <00:13:06.672>Constructor <00:13:06.800>meaning

256
00:13:08.600 --> 00:13:11.500
<00:13:08.600>you <00:13:08.833>always <00:13:09.066>keep <00:13:09.300>control <00:13:09.533>even <00:13:09.766>in <00:13:10.000>those

257
00:13:11.500 --> 00:13:14.800
<00:13:11.500>situations. <00:13:11.850>So <00:13:12.200>that's <00:13:12.550>security <00:13:12.900>as

258
00:13:14.800 --> 00:13:18.100
<00:13:14.800>well <00:13:15.079>and <00:13:15.359>not <00:13:15.640>just <00:13:15.920>easiness <00:13:16.199>and

259
00:13:17.100 --> 00:13:18.400
<00:13:17.100>I <00:13:18.270>guess

260
00:13:19.200 --> 00:13:22.300
<00:13:19.200>In <00:13:19.287>the <00:13:19.375>beginning <00:13:19.462>there <00:13:19.550>was <00:13:19.637>a <00:13:19.725>lot <00:13:19.812>of <00:13:19.900>discussion <00:13:19.987>on <00:13:20.075>people <00:13:20.162>said <00:13:20.250>oh, <00:13:20.337>but <00:13:20.425>we <00:13:20.512>cut <00:13:20.600>project

261
00:13:22.300 --> 00:13:25.400
<00:13:22.300>Lumbar <00:13:22.455>and <00:13:22.611>we'll <00:13:22.766>just <00:13:22.922>use <00:13:23.077>an <00:13:23.233>add <00:13:23.388>data <00:13:23.544>annotation. <00:13:23.699>I

262
00:13:25.400 --> 00:13:28.400
<00:13:25.400>can <00:13:25.574>do <00:13:25.750>this <00:13:25.925>nearly <00:13:26.100>the <00:13:26.275>same <00:13:26.449>even <00:13:26.625>though <00:13:26.800>records

263
00:13:28.400 --> 00:13:31.000
<00:13:28.400>are <00:13:28.600>bit <00:13:28.800>more <00:13:29.000>concise. <00:13:29.199>They <00:13:29.400>provide <00:13:29.600>more <00:13:29.800>security.

264
00:13:37.800 --> 00:13:38.100
right

265
00:13:39.700 --> 00:13:40.800
<00:13:39.700>sealed <00:13:40.689>classes

266
00:13:41.600 --> 00:13:43.400
<00:13:41.600>they <00:13:41.950>are <00:13:42.300>the <00:13:42.650>fourth <00:13:43.000>element.

267
00:13:44.700 --> 00:13:44.900
and

268
00:13:46.200 --> 00:13:46.800
<00:13:46.200>in <00:13:46.740>Java

269
00:13:47.500 --> 00:13:50.800
<00:13:47.500>If <00:13:47.700>you <00:13:47.900>look <00:13:48.100>at <00:13:48.300>object <00:13:48.500>inheritance, <00:13:48.700>you <00:13:48.900>basically

270
00:13:50.800 --> 00:13:51.600
<00:13:50.800>got <00:13:51.160>two <00:13:51.520>flavors.

271
00:13:52.600 --> 00:13:55.900
<00:13:52.600>Either <00:13:52.775>you <00:13:52.950>mark <00:13:53.125>your <00:13:53.300>class <00:13:53.475>as <00:13:53.650>final <00:13:53.825>and <00:13:54.000>no

272
00:13:55.900 --> 00:13:59.000
<00:13:55.900>one <00:13:56.100>can <00:13:56.300>inherit <00:13:56.500>from <00:13:56.699>it <00:13:56.900>like <00:13:57.100>the <00:13:57.300>string

273
00:13:58.000 --> 00:13:59.200
class.

274
00:14:00.500 --> 00:14:04.100
<00:14:00.500>Or <00:14:00.700>you <00:14:00.900>don't <00:14:01.100>Market <00:14:01.300>this <00:14:01.500>final <00:14:01.700>and <00:14:01.900>then

275
00:14:03.100 --> 00:14:06.800
<00:14:03.100>technically <00:14:03.450>anyone <00:14:03.800>can <00:14:04.150>inherit <00:14:04.500>from

276
00:14:06.800 --> 00:14:09.200
<00:14:06.800>it. <00:14:07.150>So <00:14:07.500>that <00:14:07.849>means <00:14:08.199>of

277
00:14:09.200 --> 00:14:12.600
<00:14:09.200>course <00:14:09.355>you <00:14:09.511>can <00:14:09.666>use <00:14:09.822>excess <00:14:09.977>modifiers <00:14:10.133>to <00:14:10.288>like <00:14:10.444>limit <00:14:10.600>to

278
00:14:12.600 --> 00:14:15.900
<00:14:12.600>scope. <00:14:12.755>But <00:14:12.911>basically <00:14:13.066>that's <00:14:13.222>the <00:14:13.377>two <00:14:13.533>flavors <00:14:13.688>you <00:14:13.844>have <00:14:14.000>either.

279
00:14:17.200 --> 00:14:20.100
<00:14:17.200>Anyone <00:14:17.433>can <00:14:17.666>allow <00:14:17.900>can <00:14:18.133>can <00:14:18.366>duplicate <00:14:18.600>it

280
00:14:20.100 --> 00:14:21.000
<00:14:20.100>or <00:14:20.505>no <00:14:20.910>one.

281
00:14:23.300 --> 00:14:26.500
<00:14:23.300>Enter <00:14:23.650>Shield <00:14:24.000>classes <00:14:24.349>sealed <00:14:24.699>classes

282
00:14:26.500 --> 00:14:28.100
<00:14:26.500>give <00:14:26.966>you <00:14:27.433>a <00:14:27.900>way.

283
00:14:28.600 --> 00:14:29.300
<00:14:28.600>to <00:14:29.230>control

284
00:14:31.400 --> 00:14:34.200
<00:14:31.400>which <00:14:31.600>classes <00:14:31.800>or <00:14:32.000>interfaces <00:14:32.199>because <00:14:32.400>they <00:14:32.600>apply <00:14:32.800>to

285
00:14:34.200 --> 00:14:37.100
<00:14:34.200>both <00:14:34.550>are <00:14:34.900>allowed <00:14:35.250>to <00:14:35.600>subclass.

286
00:14:39.200 --> 00:14:41.400
<00:14:39.200>Your <00:14:39.666>classes <00:14:40.133>or <00:14:40.600>interfaces?

287
00:14:43.200 --> 00:14:46.800
<00:14:43.200>The <00:14:43.327>way <00:14:43.454>it <00:14:43.581>works <00:14:43.709>is <00:14:43.836>like <00:14:43.963>this <00:14:44.090>you <00:14:44.218>define <00:14:44.345>your <00:14:44.472>class <00:14:44.600>as

288
00:14:46.800 --> 00:14:48.600
<00:14:46.800>sealed. <00:14:47.079>So <00:14:47.359>that's <00:14:47.640>a <00:14:47.920>new <00:14:48.199>keyword.

289
00:14:49.600 --> 00:14:50.900
<00:14:49.600>in <00:14:50.185>the <00:14:50.770>jvm

290
00:14:53.700 --> 00:14:56.600
<00:14:53.700>and <00:14:53.875>then <00:14:54.050>you <00:14:54.225>have <00:14:54.400>to <00:14:54.575>tell <00:14:54.750>okay <00:14:54.925>who <00:14:55.100>is

291
00:14:56.600 --> 00:14:59.300
<00:14:56.600>allowed <00:14:56.833>to <00:14:57.066>subclass <00:14:57.300>me <00:14:57.533>in <00:14:57.766>this <00:14:58.000>case

292
00:14:59.300 --> 00:15:02.700
<00:14:59.300>print <00:14:59.533>a <00:14:59.766>plugin <00:15:00.000>export <00:15:00.233>plugin <00:15:00.466>and <00:15:00.699>use

293
00:15:02.700 --> 00:15:06.000
<00:15:02.700>the <00:15:02.900>defined <00:15:03.100>plugin <00:15:03.300>are <00:15:03.500>allowed <00:15:03.700>to <00:15:03.900>subclass <00:15:04.100>any

294
00:15:05.200 --> 00:15:08.500
<00:15:05.200>other <00:15:05.433>class <00:15:05.666>that <00:15:05.900>trust <00:15:06.133>to <00:15:06.366>will <00:15:06.600>actually

295
00:15:08.500 --> 00:15:09.900
<00:15:08.500>get <00:15:08.814>a <00:15:09.130>compile <00:15:09.444>time <00:15:09.760>warning.

296
00:15:14.200 --> 00:15:17.600
<00:15:14.200>Um, <00:15:14.293>but <00:15:14.386>it's <00:15:14.480>not <00:15:14.573>all <00:15:14.666>of <00:15:14.760>it. <00:15:14.853>I <00:15:14.946>mean <00:15:15.040>we <00:15:15.133>have <00:15:15.226>these <00:15:15.320>three <00:15:15.413>classes <00:15:15.506>here, <00:15:15.600>which

297
00:15:17.600 --> 00:15:20.300
<00:15:17.600>okay <00:15:17.800>you <00:15:18.000>and <00:15:18.200>they <00:15:18.400>each <00:15:18.600>for <00:15:18.800>them <00:15:19.000>has

298
00:15:20.300 --> 00:15:23.200
<00:15:20.300>to <00:15:20.579>specify <00:15:20.859>how <00:15:21.140>they <00:15:21.420>handle <00:15:21.699>inheritance.

299
00:15:23.800 --> 00:15:26.600
<00:15:23.800>So <00:15:23.927>if <00:15:24.054>you <00:15:24.181>look <00:15:24.309>at <00:15:24.436>the <00:15:24.563>printer <00:15:24.690>plug <00:15:24.818>of <00:15:24.945>the <00:15:25.072>export <00:15:25.199>plugin

300
00:15:26.600 --> 00:15:29.600
<00:15:26.600>first, <00:15:26.755>it's <00:15:26.911>that <00:15:27.066>oh, <00:15:27.222>well, <00:15:27.377>there's <00:15:27.533>two <00:15:27.688>possible <00:15:27.844>ways <00:15:28.000>to

301
00:15:29.600 --> 00:15:32.400
<00:15:29.600>export <00:15:29.775>in <00:15:29.950>my <00:15:30.125>code. <00:15:30.300>So <00:15:30.475>I've <00:15:30.650>got <00:15:30.825>a <00:15:31.000>JPEG

302
00:15:32.400 --> 00:15:35.400
<00:15:32.400>and <00:15:32.600>a <00:15:32.800>PDF <00:15:33.000>export <00:15:33.199>so <00:15:33.400>it <00:15:33.600>calls <00:15:33.800>itself

303
00:15:35.400 --> 00:15:37.100
<00:15:35.400>a <00:15:35.866>sealed <00:15:36.333>class <00:15:36.800>again.

304
00:15:38.400 --> 00:15:41.900
<00:15:38.400>So <00:15:38.866>continuing <00:15:39.333>the <00:15:39.800>limitation

305
00:15:43.500 --> 00:15:45.300
<00:15:43.500>of <00:15:44.200>object <00:15:44.900>inheritance

306
00:15:46.400 --> 00:15:49.900
<00:15:46.400>The <00:15:46.574>printer <00:15:46.750>plugin <00:15:46.925>says <00:15:47.100>well, <00:15:47.275>it's <00:15:47.449>easy. <00:15:47.625>There's <00:15:47.800>just

307
00:15:49.900 --> 00:15:52.600
<00:15:49.900>one <00:15:50.100>printer <00:15:50.300>plugin. <00:15:50.500>So <00:15:50.699>it <00:15:50.900>is <00:15:51.100>defined <00:15:51.300>final.

308
00:15:53.600 --> 00:15:56.200
<00:15:53.600>That's <00:15:53.880>the <00:15:54.160>same <00:15:54.440>final <00:15:54.720>keyword <00:15:55.000>that

309
00:15:56.200 --> 00:15:59.500
<00:15:56.200>we <00:15:56.480>already <00:15:56.760>know <00:15:57.040>meaning <00:15:57.320>no <00:15:57.600>one

310
00:15:59.500 --> 00:16:01.500
<00:15:59.500>can <00:15:59.700>subclass <00:15:59.900>me. <00:16:00.100>This <00:16:00.300>is <00:16:00.500>where <00:16:00.700>it <00:16:00.900>ends.

311
00:16:03.400 --> 00:16:06.400
<00:16:03.400>And <00:16:03.574>then <00:16:03.750>finally <00:16:03.925>the <00:16:04.100>use <00:16:04.275>to <00:16:04.449>define <00:16:04.625>plugin. <00:16:04.800>It

312
00:16:06.400 --> 00:16:09.400
<00:16:06.400>defines <00:16:06.600>something <00:16:06.800>as <00:16:07.000>non-sealed <00:16:07.199>just <00:16:07.400>the <00:16:07.600>third <00:16:07.800>keyword

313
00:16:09.400 --> 00:16:10.300
<00:16:09.400>that <00:16:09.602>was <00:16:09.805>added <00:16:10.007>for <00:16:10.209>this.

314
00:16:11.400 --> 00:16:14.200
<00:16:11.400>And <00:16:11.555>basically <00:16:11.711>you're <00:16:11.866>now <00:16:12.022>saying <00:16:12.177>you <00:16:12.333>know <00:16:12.488>what? <00:16:12.644>I <00:16:12.800>don't

315
00:16:14.200 --> 00:16:17.500
<00:16:14.200>want <00:16:14.327>to <00:16:14.454>be <00:16:14.581>a <00:16:14.709>part <00:16:14.836>of <00:16:14.963>this <00:16:15.090>like <00:16:15.218>exclusive <00:16:15.345>Club <00:16:15.472>anyone <00:16:15.600>can

316
00:16:17.500 --> 00:16:18.200
<00:16:17.500>subclass <00:16:18.130>me.

317
00:16:19.400 --> 00:16:22.700
<00:16:19.400>And <00:16:19.555>though <00:16:19.711>it <00:16:19.866>may <00:16:20.022>sound <00:16:20.177>like <00:16:20.333>this <00:16:20.488>is <00:16:20.644>where <00:16:20.800>object.

318
00:16:23.300 --> 00:16:24.900
<00:16:23.300>where <00:16:24.699>you

319
00:16:26.100 --> 00:16:29.400
<00:16:26.100>Ending <00:16:26.275>the <00:16:26.450>object <00:16:26.625>inhabitants. <00:16:26.800>Basically <00:16:26.975>it <00:16:27.150>is <00:16:27.325>not <00:16:27.500>because

320
00:16:29.400 --> 00:16:32.400
<00:16:29.400>the <00:16:29.600>compiler <00:16:29.800>still <00:16:30.000>knows <00:16:30.199>it <00:16:30.400>has <00:16:30.600>an <00:16:30.800>export

321
00:16:32.400 --> 00:16:34.900
<00:16:32.400>plugin <00:16:32.633>printer <00:16:32.866>plugin <00:16:33.100>used <00:16:33.333>to <00:16:33.566>define <00:16:33.800>plugin.

322
00:16:37.200 --> 00:16:41.200
<00:16:37.200>So <00:16:37.327>if <00:16:37.454>you <00:16:37.581>look <00:16:37.709>like <00:16:37.836>at <00:16:37.963>the <00:16:38.090>switch <00:16:38.218>statement <00:16:38.345>that <00:16:38.472>switch <00:16:38.600>expression

323
00:16:40.200 --> 00:16:43.200
<00:16:40.200>we <00:16:40.550>saw <00:16:40.900>before <00:16:41.250>suddenly <00:16:41.600>we

324
00:16:43.200 --> 00:16:46.400
<00:16:43.200>can <00:16:43.340>use <00:16:43.480>it <00:16:43.620>like <00:16:43.760>this <00:16:43.900>on <00:16:44.040>passing <00:16:44.180>in <00:16:44.320>something <00:16:44.460>of <00:16:44.600>a

325
00:16:46.400 --> 00:16:46.600
plugin.

326
00:16:47.300 --> 00:16:50.300
<00:16:47.300>And <00:16:47.416>I <00:16:47.533>can <00:16:47.650>say <00:16:47.766>oh, <00:16:47.883>it's <00:16:48.000>either <00:16:48.116>a <00:16:48.233>printer <00:16:48.349>Plugin <00:16:48.466>or <00:16:48.583>an <00:16:48.699>export

327
00:16:50.300 --> 00:16:53.300
<00:16:50.300>Plugin <00:16:50.439>or <00:16:50.579>use <00:16:50.719>a <00:16:50.859>defined <00:16:51.000>plugin. <00:16:51.140>I <00:16:51.280>don't <00:16:51.420>have <00:16:51.560>to <00:16:51.699>use

328
00:16:53.300 --> 00:16:57.000
<00:16:53.300>default <00:16:53.533>cases <00:16:53.766>anymore <00:16:54.000>because <00:16:54.233>the <00:16:54.466>compiler <00:16:54.699>because

329
00:16:56.200 --> 00:17:00.200
<00:16:56.200>of <00:16:56.400>the <00:16:56.600>object <00:16:56.800>tree <00:16:57.000>can <00:16:57.200>now <00:16:57.400>reason <00:16:57.600>about

330
00:16:59.200 --> 00:17:02.500
<00:16:59.200>exhaustiveness <00:17:00.600>knowing

331
00:17:02.500 --> 00:17:05.000
<00:17:02.500>if <00:17:02.675>you <00:17:02.850>reached <00:17:03.025>all <00:17:03.200>classes <00:17:03.375>and <00:17:03.550>basically <00:17:03.725>we <00:17:03.900>have

332
00:17:05.300 --> 00:17:08.500
<00:17:05.300>because <00:17:05.440>these <00:17:05.579>are <00:17:05.720>all <00:17:05.859>the <00:17:06.000>subclasses. <00:17:06.139>So <00:17:06.280>this <00:17:06.419>is <00:17:06.560>a <00:17:06.700>perfectly

333
00:17:08.500 --> 00:17:10.900
<00:17:08.500>nice <00:17:08.849>way <00:17:09.200>of <00:17:09.550>working <00:17:09.900>together.

334
00:17:12.300 --> 00:17:13.900
<00:17:12.300>actually <00:17:12.579>what <00:17:12.859>we're <00:17:13.139>seeing <00:17:13.419>here <00:17:13.700>is

335
00:17:15.400 --> 00:17:17.700
<00:17:15.400>the <00:17:15.866>switch <00:17:16.333>expression <00:17:16.800>used

336
00:17:21.200 --> 00:17:25.700
<00:17:21.200>to <00:17:21.375>identify <00:17:21.550>this <00:17:21.725>classes <00:17:21.900>and <00:17:22.075>to <00:17:22.250>use <00:17:22.425>pattern <00:17:22.600>matching.

337
00:17:27.900 --> 00:17:30.400
<00:17:27.900>And <00:17:28.100>that's <00:17:28.300>a <00:17:28.500>good <00:17:28.700>fit <00:17:28.900>because <00:17:29.100>pattern <00:17:29.300>matching

338
00:17:30.400 --> 00:17:33.800
<00:17:30.400>is <00:17:30.633>the <00:17:30.866>fifth <00:17:31.100>and <00:17:31.333>final <00:17:31.566>element. <00:17:31.800>We're

339
00:17:33.800 --> 00:17:34.200
<00:17:33.800>going <00:17:33.920>to <00:17:34.040>talk <00:17:34.160>about

340
00:17:36.100 --> 00:17:37.400
<00:17:36.100>so <00:17:36.392>what <00:17:36.685>is <00:17:36.977>pattern <00:17:37.270>matching?

341
00:17:39.900 --> 00:17:43.500
<00:17:39.900>Pattern <00:17:40.100>matching <00:17:40.300>is <00:17:40.500>actually <00:17:40.700>a <00:17:40.900>two-stage <00:17:41.100>process. <00:17:41.300>We

342
00:17:42.500 --> 00:17:44.600
<00:17:42.500>have <00:17:42.966>a <00:17:43.433>certain <00:17:43.900>object.

343
00:17:46.300 --> 00:17:49.200
<00:17:46.300>On <00:17:46.475>which <00:17:46.649>we <00:17:46.825>will <00:17:47.000>apply <00:17:47.175>a <00:17:47.350>predicate <00:17:47.524>or <00:17:47.700>test.

344
00:17:50.100 --> 00:17:52.200
<00:17:50.100>And <00:17:50.379>if <00:17:50.659>that <00:17:50.939>test <00:17:51.219>is <00:17:51.500>successful.

345
00:17:53.200 --> 00:17:53.900
<00:17:53.200>then <00:17:53.830>certain

346
00:17:54.700 --> 00:17:57.100
<00:17:54.700>values <00:17:54.980>of <00:17:55.260>the <00:17:55.540>object <00:17:55.820>are <00:17:56.100>going

347
00:17:57.100 --> 00:18:00.100
<00:17:57.100>to <00:17:57.274>be <00:17:57.449>extracted <00:17:57.625>into <00:17:57.800>what <00:17:57.975>we <00:17:58.149>call <00:17:58.324>pattern <00:17:58.500>variables.

348
00:18:01.900 --> 00:18:04.700
<00:18:01.900>Actually <00:18:02.100>when <00:18:02.300>we <00:18:02.500>look <00:18:02.700>back <00:18:02.900>here <00:18:03.100>then <00:18:03.300>for

349
00:18:04.700 --> 00:18:05.300
instance.

350
00:18:06.800 --> 00:18:09.800
<00:18:06.800>This <00:18:07.033>he <00:18:07.266>this <00:18:07.500>values <00:18:07.733>those <00:18:07.966>are <00:18:08.200>pattern

351
00:18:09.800 --> 00:18:10.200
variables.

352
00:18:13.500 --> 00:18:16.400
<00:18:13.500>Looking <00:18:13.733>again <00:18:13.966>at <00:18:14.200>this <00:18:14.433>interface <00:18:14.666>here. <00:18:14.900>We

353
00:18:16.400 --> 00:18:20.200
<00:18:16.400>said <00:18:16.575>oh <00:18:16.750>wait <00:18:16.925>a <00:18:17.100>minute. <00:18:17.275>We <00:18:17.450>had <00:18:17.625>this <00:18:17.800>plugin

354
00:18:19.200 --> 00:18:22.000
<00:18:19.200>interface <00:18:19.666>and <00:18:20.133>it <00:18:20.600>defined.

355
00:18:22.900 --> 00:18:25.100
<00:18:22.900>Some <00:18:23.133>classes <00:18:23.366>that <00:18:23.600>allowed <00:18:23.833>to <00:18:24.066>subclass <00:18:24.300>it.

356
00:18:25.600 --> 00:18:28.500
<00:18:25.600>So <00:18:25.833>we <00:18:26.066>had <00:18:26.300>this <00:18:26.533>non-sealed <00:18:26.766>user-defined <00:18:27.000>plugin

357
00:18:28.500 --> 00:18:31.300
<00:18:28.500>and <00:18:28.655>we <00:18:28.811>can <00:18:28.966>define <00:18:29.122>an <00:18:29.277>extra <00:18:29.433>method <00:18:29.588>in <00:18:29.744>it <00:18:29.900>in

358
00:18:31.300 --> 00:18:34.300
<00:18:31.300>it <00:18:31.500>extended <00:18:31.700>because <00:18:31.899>each <00:18:32.100>user <00:18:32.300>defines <00:18:32.500>so <00:18:32.700>probably

359
00:18:34.300 --> 00:18:35.800
<00:18:34.300>they <00:18:34.524>want <00:18:34.750>to <00:18:34.975>do <00:18:35.200>some <00:18:35.425>extra <00:18:35.649>things.

360
00:18:39.300 --> 00:18:40.100
<00:18:39.300>the <00:18:39.659>first <00:18:40.020>element

361
00:18:41.200 --> 00:18:44.700
<00:18:41.200>that <00:18:41.375>got <00:18:41.550>pattern <00:18:41.725>matching <00:18:41.900>was <00:18:42.075>actually <00:18:42.250>the <00:18:42.425>instance <00:18:42.600>of

362
00:18:44.700 --> 00:18:47.200
<00:18:44.700>we <00:18:44.855>already <00:18:45.011>know <00:18:45.166>in <00:18:45.322>Java <00:18:45.477>the <00:18:45.633>instance <00:18:45.788>of <00:18:45.944>there <00:18:46.100>was

363
00:18:47.200 --> 00:18:47.700
<00:18:47.200>an <00:18:47.650>operator.

364
00:18:48.400 --> 00:18:50.300
<00:18:48.400>This <00:18:49.100>here <00:18:49.800>now.

365
00:18:51.600 --> 00:18:54.900
<00:18:51.600>if <00:18:51.800>we <00:18:52.000>say <00:18:52.199>plug-in <00:18:52.399>instance <00:18:52.600>of <00:18:52.800>user-defined <00:18:53.000>plugin

366
00:18:54.100 --> 00:18:55.400
UDP

367
00:18:56.400 --> 00:18:59.600
<00:18:56.400>This <00:18:56.680>here <00:18:56.960>is <00:18:57.240>the <00:18:57.520>predicate <00:18:57.800>and

368
00:18:59.600 --> 00:19:02.800
<00:18:59.600>this <00:18:59.774>here <00:18:59.949>is <00:19:00.125>the <00:19:00.300>pattern <00:19:00.475>variable. <00:19:00.649>If <00:19:00.824>this <00:19:01.000>test

369
00:19:02.800 --> 00:19:05.300
<00:19:02.800>is <00:19:03.080>successful <00:19:03.360>then <00:19:03.639>UDP <00:19:03.919>will <00:19:04.200>now

370
00:19:05.300 --> 00:19:08.600
<00:19:05.300>be <00:19:05.580>an <00:19:05.860>instance <00:19:06.139>of <00:19:06.419>user <00:19:06.700>defined

371
00:19:08.600 --> 00:19:11.200
<00:19:08.600>plugin. <00:19:08.833>It <00:19:09.066>looks <00:19:09.300>like <00:19:09.533>simple <00:19:09.766>casting <00:19:10.000>and

372
00:19:11.200 --> 00:19:14.400
<00:19:11.200>you <00:19:11.355>can <00:19:11.511>say <00:19:11.666>okay. <00:19:11.822>Well <00:19:11.977>that's <00:19:12.133>very <00:19:12.288>very <00:19:12.444>basic <00:19:12.600>and

373
00:19:14.400 --> 00:19:17.300
<00:19:14.400>it <00:19:14.540>actually <00:19:14.680>is <00:19:14.820>but <00:19:14.960>it's <00:19:15.100>just <00:19:15.240>the <00:19:15.380>beginning <00:19:15.520>of <00:19:15.660>a <00:19:15.800>lot

374
00:19:17.300 --> 00:19:20.000
<00:19:17.300>of <00:19:17.500>pattern <00:19:17.700>matching <00:19:17.899>going <00:19:18.100>on <00:19:18.300>in <00:19:18.500>a <00:19:18.700>jvm.

375
00:19:22.600 --> 00:19:24.300
<00:19:22.600>continuing <00:19:23.066>with <00:19:23.533>the <00:19:24.000>example

376
00:19:25.600 --> 00:19:28.500
<00:19:25.600>So <00:19:25.800>we're <00:19:26.000>saying <00:19:26.199>okay <00:19:26.399>now <00:19:26.600>I'm <00:19:26.800>concernedly <00:19:27.000>called

377
00:19:28.700 --> 00:19:30.100
<00:19:28.700>UDP <00:19:29.960>extended.

378
00:19:33.900 --> 00:19:36.300
<00:19:33.900>Um <00:19:34.133>same <00:19:34.366>situation <00:19:34.600>here <00:19:34.833>that <00:19:35.066>we're <00:19:35.300>already

379
00:19:36.300 --> 00:19:39.300
<00:19:36.300>had <00:19:36.440>before <00:19:36.580>we <00:19:36.720>had <00:19:36.860>to <00:19:37.000>huge <00:19:37.139>Define <00:19:37.280>plug-in <00:19:37.419>and <00:19:37.560>this <00:19:37.700>is

380
00:19:39.300 --> 00:19:42.700
<00:19:39.300>switch <00:19:39.533>pattern <00:19:39.766>matching <00:19:40.000>and <00:19:40.233>again <00:19:40.466>because <00:19:40.700>it

381
00:19:42.700 --> 00:19:45.200
<00:19:42.700>is <00:19:42.980>exhaustive. <00:19:43.260>It <00:19:43.540>knows <00:19:43.820>about <00:19:44.100>all

382
00:19:45.200 --> 00:19:50.100
<00:19:45.200>the <00:19:45.355>possible <00:19:45.511>values <00:19:45.666>we <00:19:45.822>can <00:19:45.977>use <00:19:46.133>it <00:19:46.288>like <00:19:46.444>without <00:19:46.600>the

383
00:19:49.100 --> 00:19:51.200
<00:19:49.100>default <00:19:50.500>statement.

384
00:19:53.700 --> 00:19:57.200
<00:19:53.700>and <00:19:53.875>pattern <00:19:54.050>matching <00:19:54.225>goes <00:19:54.400>Way <00:19:54.575>Beyond <00:19:54.750>this <00:19:54.925>there <00:19:55.100>is

385
00:19:58.900 --> 00:20:01.500
<00:19:58.900>this <00:19:59.133>situation <00:19:59.366>which <00:19:59.600>is <00:19:59.833>called <00:20:00.066>the <00:20:00.300>guard

386
00:20:01.500 --> 00:20:04.600
<00:20:01.500>pattern <00:20:01.675>and <00:20:01.850>it <00:20:02.025>goes <00:20:02.200>to <00:20:02.375>step <00:20:02.550>further. <00:20:02.725>It <00:20:02.900>has

387
00:20:04.600 --> 00:20:07.100
<00:20:04.600>a <00:20:04.774>few <00:20:04.949>things <00:20:05.125>first <00:20:05.300>of <00:20:05.475>all, <00:20:05.649>it <00:20:05.824>allows <00:20:06.000>here.

388
00:20:08.400 --> 00:20:11.800
<00:20:08.400>The <00:20:08.633>case <00:20:08.866>no <00:20:09.100>normally <00:20:09.333>in <00:20:09.566>a <00:20:09.800>traditional

389
00:20:11.800 --> 00:20:14.600
<00:20:11.800>switch <00:20:12.266>statement <00:20:12.733>you <00:20:13.200>can

390
00:20:14.600 --> 00:20:15.000
<00:20:14.600>use <00:20:14.960>this.

391
00:20:15.700 --> 00:20:18.500
<00:20:15.700>If <00:20:15.900>the <00:20:16.100>value <00:20:16.300>you <00:20:16.500>were <00:20:16.700>casing <00:20:16.900>on <00:20:17.100>was

392
00:20:18.500 --> 00:20:21.100
<00:20:18.500>null <00:20:18.640>if <00:20:18.780>the <00:20:18.920>object <00:20:19.060>was <00:20:19.200>no <00:20:19.340>you <00:20:19.480>would <00:20:19.620>get <00:20:19.760>a <00:20:19.900>no

393
00:20:21.100 --> 00:20:23.000
<00:20:21.100>point <00:20:21.255>or <00:20:21.411>exception. <00:20:21.566>So <00:20:21.722>this <00:20:21.877>was <00:20:22.033>added <00:20:22.188>to <00:20:22.344>the <00:20:22.500>language.

394
00:20:23.800 --> 00:20:26.700
<00:20:23.800>And <00:20:24.033>now <00:20:24.266>there's <00:20:24.500>additional <00:20:24.733>tests. <00:20:24.966>So <00:20:25.200>it's

395
00:20:26.700 --> 00:20:29.500
<00:20:26.700>testing <00:20:26.855>here. <00:20:27.011>Oh <00:20:27.166>is <00:20:27.322>this <00:20:27.477>thing? <00:20:27.633>Is <00:20:27.788>this <00:20:27.944>a <00:20:28.100>string?

396
00:20:30.300 --> 00:20:33.500
<00:20:30.300>And <00:20:30.407>if <00:20:30.515>it <00:20:30.623>is <00:20:30.730>a <00:20:30.838>string <00:20:30.946>then <00:20:31.053>it <00:20:31.161>will <00:20:31.269>be <00:20:31.376>extracted <00:20:31.484>to <00:20:31.592>the <00:20:31.700>edge

397
00:20:33.500 --> 00:20:36.500
<00:20:33.500>variable <00:20:33.675>and <00:20:33.850>then <00:20:34.025>you <00:20:34.200>can <00:20:34.375>directly <00:20:34.550>use <00:20:34.725>that <00:20:34.900>s

398
00:20:36.500 --> 00:20:39.200
<00:20:36.500>variable <00:20:36.700>to <00:20:36.900>put <00:20:37.100>account <00:20:37.300>of <00:20:37.500>a <00:20:37.700>guard <00:20:37.900>on

399
00:20:39.200 --> 00:20:42.000
<00:20:39.200>it. <00:20:39.355>I <00:20:39.511>think <00:20:39.666>actually <00:20:39.822>in <00:20:39.977>a <00:20:40.133>later <00:20:40.288>version <00:20:40.444>they <00:20:40.600>have

400
00:20:42.200 --> 00:20:45.200
<00:20:42.200>replaced <00:20:42.666>the <00:20:43.133>not <00:20:43.600>you

401
00:20:45.200 --> 00:20:48.500
<00:20:45.200>this <00:20:45.400>one <00:20:45.600>that <00:20:45.800>the <00:20:46.000>end <00:20:46.200>presence <00:20:46.400>are <00:20:46.600>replaced

402
00:20:48.500 --> 00:20:51.600
<00:20:48.500>with <00:20:48.627>the <00:20:48.754>one <00:20:48.881>keyword <00:20:49.009>to <00:20:49.136>give <00:20:49.263>it <00:20:49.390>even <00:20:49.518>more <00:20:49.645>sense <00:20:49.772>of <00:20:49.900>guarding.

403
00:21:00.400 --> 00:21:03.800
<00:21:00.400>The <00:21:00.633>case <00:21:00.866>statements <00:21:01.100>are <00:21:01.333>evaluate <00:21:01.566>evaluated <00:21:01.800>top

404
00:21:03.800 --> 00:21:06.800
<00:21:03.800>to <00:21:04.149>bottom <00:21:04.500>meaning <00:21:04.850>if <00:21:05.200>the

405
00:21:06.800 --> 00:21:09.300
<00:21:06.800>last <00:21:07.033>two <00:21:07.266>string <00:21:07.500>statements <00:21:07.733>if <00:21:07.966>they <00:21:08.200>were

406
00:21:09.300 --> 00:21:12.400
<00:21:09.300>reversed <00:21:09.440>it <00:21:09.580>would <00:21:09.720>actually <00:21:09.860>have <00:21:10.000>taken <00:21:10.139>the <00:21:10.280>first <00:21:10.419>one <00:21:10.560>and <00:21:10.700>not

407
00:21:12.400 --> 00:21:15.200
<00:21:12.400>the <00:21:12.633>second <00:21:12.866>one <00:21:13.100>even <00:21:13.333>though <00:21:13.566>that <00:21:13.800>would

408
00:21:15.200 --> 00:21:16.000
<00:21:15.200>be <00:21:15.440>the <00:21:15.680>correct <00:21:15.920>one.

409
00:21:16.700 --> 00:21:19.100
<00:21:16.700>so <00:21:16.855>there <00:21:17.011>is <00:21:17.166>a <00:21:17.322>kind <00:21:17.477>of <00:21:17.633>order <00:21:17.788>where <00:21:17.944>you <00:21:18.100>have

410
00:21:19.100 --> 00:21:19.300
to

411
00:21:21.200 --> 00:21:22.200
<00:21:21.200>that <00:21:21.425>you <00:21:21.650>have <00:21:21.875>to <00:21:22.100>honor.

412
00:21:24.600 --> 00:21:28.000
<00:21:24.600>That's <00:21:24.879>even <00:21:25.159>more <00:21:25.439>patterns <00:21:25.719>that <00:21:26.000>there's

413
00:21:27.200 --> 00:21:30.100
<00:21:27.200>something <00:21:27.480>called <00:21:27.760>a <00:21:28.040>parenthesized <00:21:28.320>pattern <00:21:28.600>which

414
00:21:30.100 --> 00:21:33.900
<00:21:30.100>I'm <00:21:30.240>not <00:21:30.379>even <00:21:30.520>going <00:21:30.659>into <00:21:30.800>because <00:21:30.939>it's <00:21:31.080>kind <00:21:31.219>of <00:21:31.360>an <00:21:31.500>exceptional

415
00:21:33.900 --> 00:21:36.700
<00:21:33.900>case <00:21:34.250>for <00:21:34.600>Java <00:21:34.950>19. <00:21:35.300>There's

416
00:21:36.700 --> 00:21:39.900
<00:21:36.700>also <00:21:36.933>record <00:21:37.166>pattern <00:21:37.400>matching, <00:21:37.633>which <00:21:37.866>allows <00:21:38.100>you

417
00:21:41.500 --> 00:21:44.900
<00:21:41.500>To <00:21:41.655>check <00:21:41.811>for <00:21:41.966>certain <00:21:42.122>structure <00:21:42.277>of <00:21:42.433>a <00:21:42.588>record <00:21:42.744>and <00:21:42.900>if

418
00:21:44.900 --> 00:21:48.200
<00:21:44.900>it <00:21:45.075>is <00:21:45.250>there <00:21:45.425>you <00:21:45.600>can <00:21:45.775>automatically <00:21:45.950>extract <00:21:46.125>values <00:21:46.300>into

419
00:21:47.200 --> 00:21:49.500
<00:21:47.200>pattern <00:21:48.600>variables.

420
00:21:53.200 --> 00:21:57.200
<00:21:53.200>Great <00:21:53.400>now <00:21:53.600>to <00:21:53.800>one <00:21:54.000>more <00:21:54.200>like <00:21:54.400>real-world <00:21:54.600>example

421
00:21:56.200 --> 00:21:59.200
<00:21:56.200>of <00:21:56.480>how <00:21:56.760>to <00:21:57.040>use <00:21:57.320>everything <00:21:57.600>together.

422
00:22:01.900 --> 00:22:04.300
<00:22:01.900>Um, <00:22:02.016>this <00:22:02.133>is <00:22:02.250>actually <00:22:02.366>an <00:22:02.483>example <00:22:02.600>that <00:22:02.716>made <00:22:02.833>by <00:22:02.950>me <00:22:03.066>but <00:22:03.183>by <00:22:03.300>Brian

423
00:22:04.300 --> 00:22:07.300
<00:22:04.300>gutz <00:22:04.440>who's <00:22:04.580>one <00:22:04.720>of <00:22:04.860>the <00:22:05.000>language <00:22:05.139>architects <00:22:05.280>of <00:22:05.419>java <00:22:05.560>and <00:22:05.700>he

424
00:22:07.300 --> 00:22:12.000
<00:22:07.300>published <00:22:07.475>it <00:22:07.649>and <00:22:07.825>he <00:22:08.000>said, <00:22:08.175>you <00:22:08.350>know, <00:22:08.524>we <00:22:08.700>when

425
00:22:10.300 --> 00:22:13.600
<00:22:10.300>we <00:22:10.649>Define <00:22:11.000>the <00:22:11.350>future <00:22:11.700>interface,

426
00:22:13.600 --> 00:22:16.200
<00:22:13.600>it <00:22:13.833>looked <00:22:14.066>like <00:22:14.300>this. <00:22:14.533>There's <00:22:14.766>some <00:22:15.000>kind

427
00:22:16.200 --> 00:22:20.000
<00:22:16.200>of <00:22:16.355>object <00:22:16.511>there <00:22:16.666>on <00:22:16.822>which <00:22:16.977>we <00:22:17.133>can <00:22:17.288>call <00:22:17.444>a <00:22:17.600>get.

428
00:22:20.800 --> 00:22:23.600
<00:22:20.800>And <00:22:21.033>it <00:22:21.266>has <00:22:21.500>a <00:22:21.733>timeout <00:22:21.966>in <00:22:22.200>time

429
00:22:23.600 --> 00:22:26.300
<00:22:23.600>units <00:22:23.800>and <00:22:24.000>it <00:22:24.199>throws <00:22:24.399>three <00:22:24.600>kinds <00:22:24.800>of <00:22:25.000>exceptions.

430
00:22:27.800 --> 00:22:29.000
<00:22:27.800>So <00:22:28.070>when <00:22:28.340>you <00:22:28.610>are <00:22:28.880>actually

431
00:22:31.600 --> 00:22:33.900
<00:22:31.600>Calling <00:22:31.879>code <00:22:32.159>it <00:22:32.439>looks <00:22:32.719>like <00:22:33.000>this.

432
00:22:36.300 --> 00:22:39.900
<00:22:36.300>Not <00:22:36.440>very <00:22:36.580>elegant <00:22:36.720>code <00:22:36.860>is <00:22:37.000>it <00:22:37.139>I <00:22:37.280>mean, <00:22:37.419>there's <00:22:37.560>more <00:22:37.700>error-handling

433
00:22:39.900 --> 00:22:42.900
<00:22:39.900>than <00:22:40.100>normal <00:22:40.300>coding <00:22:40.500>in <00:22:40.700>there. <00:22:40.900>And <00:22:41.100>so <00:22:41.300>it's

434
00:22:42.900 --> 00:22:43.800
<00:22:42.900>really <00:22:43.710>confusing.

435
00:22:44.500 --> 00:22:45.500
<00:22:44.500>So <00:22:44.950>he <00:22:45.400>said

436
00:22:46.200 --> 00:22:49.300
<00:22:46.200>if <00:22:46.480>we <00:22:46.760>had <00:22:47.040>pattern <00:22:47.320>matching <00:22:47.600>if

437
00:22:49.300 --> 00:22:51.700
<00:22:49.300>we <00:22:49.580>had <00:22:49.860>sealed <00:22:50.139>classes <00:22:50.419>and <00:22:50.700>Records.

438
00:22:52.900 --> 00:22:54.000
<00:22:52.900>and <00:22:53.395>switch <00:22:53.890>expressions

439
00:22:57.200 --> 00:23:00.500
<00:22:57.200>We <00:22:57.355>could <00:22:57.511>have <00:22:57.666>done <00:22:57.822>it <00:22:57.977>like <00:22:58.133>this <00:22:58.288>here. <00:22:58.444>Basically <00:22:58.600>we're

440
00:23:00.500 --> 00:23:02.600
<00:23:00.500>saying <00:23:00.733>okay. <00:23:00.966>We <00:23:01.200>got <00:23:01.433>a <00:23:01.666>sealed <00:23:01.900>interface.

441
00:23:03.900 --> 00:23:06.800
<00:23:03.900>There's <00:23:04.133>four <00:23:04.366>methods <00:23:04.600>in <00:23:04.833>there <00:23:05.066>these <00:23:05.300>four

442
00:23:06.800 --> 00:23:09.800
<00:23:06.800>message <00:23:07.080>because <00:23:07.360>as <00:23:07.639>they <00:23:07.919>return <00:23:08.200>a

443
00:23:09.800 --> 00:23:11.900
<00:23:09.800>record, <00:23:10.149>they <00:23:10.500>are <00:23:10.850>implicitly <00:23:11.200>final.

444
00:23:14.200 --> 00:23:17.400
<00:23:14.200>And <00:23:14.433>they <00:23:14.666>implement <00:23:14.900>this <00:23:15.133>async <00:23:15.366>return <00:23:15.600>method.

445
00:23:19.600 --> 00:23:21.600
<00:23:19.600>Then <00:23:19.800>calling <00:23:20.000>the <00:23:20.199>code <00:23:20.399>would <00:23:20.600>be <00:23:20.800>like <00:23:21.000>this.

446
00:23:24.400 --> 00:23:26.000
<00:23:24.400>You <00:23:24.750>got <00:23:25.100>a <00:23:25.450>async <00:23:25.800>result.

447
00:23:27.600 --> 00:23:30.600
<00:23:27.600>You <00:23:27.740>do <00:23:27.879>the <00:23:28.020>future <00:23:28.159>get <00:23:28.300>and <00:23:28.439>then <00:23:28.580>you <00:23:28.719>can <00:23:28.860>switch <00:23:29.000>on

448
00:23:30.600 --> 00:23:33.600
<00:23:30.600>the <00:23:30.755>type <00:23:30.911>of <00:23:31.066>record <00:23:31.222>that <00:23:31.377>you <00:23:31.533>got <00:23:31.688>returned <00:23:31.844>and <00:23:32.000>then

449
00:23:33.600 --> 00:23:37.200
<00:23:33.600>handle <00:23:34.066>the <00:23:34.533>result <00:23:35.000>that

450
00:23:37.200 --> 00:23:40.600
<00:23:37.200>you <00:23:37.340>got <00:23:37.480>handle <00:23:37.620>it <00:23:37.760>accordingly, <00:23:37.900>which <00:23:38.040>I <00:23:38.180>think <00:23:38.320>looks <00:23:38.460>for <00:23:38.600>way

451
00:23:40.600 --> 00:23:43.900
<00:23:40.600>more <00:23:40.800>elegant <00:23:41.000>coat. <00:23:41.199>So <00:23:41.399>here <00:23:41.600>we <00:23:41.800>see <00:23:42.000>both

452
00:23:43.900 --> 00:23:46.600
<00:23:43.900>the <00:23:44.180>switch <00:23:44.460>Expressions. <00:23:44.740>We <00:23:45.020>see <00:23:45.300>records.

453
00:23:49.300 --> 00:23:51.100
<00:23:49.300>And <00:23:49.766>we <00:23:50.233>Shield <00:23:50.700>classes.

454
00:23:56.300 --> 00:23:59.200
<00:23:56.300>examples <00:23:56.455>can <00:23:56.611>be <00:23:56.766>found <00:23:56.922>here <00:23:57.077>if <00:23:57.233>you <00:23:57.388>want <00:23:57.544>any <00:23:57.700>more

455
00:23:59.200 --> 00:24:00.500
<00:23:59.200>examples <00:24:00.370>and

456
00:24:01.400 --> 00:24:04.100
<00:24:01.400>then <00:24:01.600>I <00:24:01.800>think <00:24:02.000>it <00:24:02.200>is <00:24:02.400>time <00:24:02.600>for <00:24:02.800>questions.

457
00:24:05.700 --> 00:24:06.300
<00:24:05.700>if <00:24:06.240>any

458
00:24:08.600 --> 00:24:08.900
<00:24:08.600>thank <00:24:08.870>you.

459
00:24:14.400 --> 00:24:17.400
<00:24:14.400>Okay, <00:24:14.555>so <00:24:14.711>of <00:24:14.866>course, <00:24:15.022>there <00:24:15.177>are <00:24:15.333>some <00:24:15.488>questions. <00:24:15.644>Okay, <00:24:15.800>many

460
00:24:17.400 --> 00:24:20.500
<00:24:17.400>of <00:24:17.540>them <00:24:17.680>actually. <00:24:17.820>So <00:24:17.960>the <00:24:18.100>most <00:24:18.240>up <00:24:18.380>voted <00:24:18.520>one <00:24:18.660>is <00:24:18.800>actually

461
00:24:20.500 --> 00:24:23.200
<00:24:20.500>could <00:24:20.780>you <00:24:21.060>please <00:24:21.340>serve <00:24:21.620>you <00:24:21.900>words

462
00:24:23.200 --> 00:24:26.400
<00:24:23.200>with <00:24:23.433>regarding <00:24:23.666>the <00:24:23.900>specific <00:24:24.133>Frameworks <00:24:24.366>like <00:24:24.600>spring

463
00:24:26.400 --> 00:24:29.500
<00:24:26.400>and <00:24:26.600>so <00:24:26.800>on <00:24:27.000>and <00:24:27.200>the <00:24:27.400>support <00:24:27.600>for <00:24:27.800>records?

464
00:24:29.500 --> 00:24:32.300
<00:24:29.500>Yeah, <00:24:29.733>that's <00:24:29.966>a <00:24:30.200>very <00:24:30.433>good <00:24:30.666>very <00:24:30.900>good

465
00:24:32.300 --> 00:24:35.300
<00:24:32.300>question <00:24:32.455>actually <00:24:32.611>because <00:24:32.766>that's <00:24:32.922>one <00:24:33.077>of <00:24:33.233>the <00:24:33.388>parts <00:24:33.544>I <00:24:33.700>forgot.

466
00:24:35.300 --> 00:24:38.800
<00:24:35.300>So <00:24:35.475>why <00:24:35.649>would <00:24:35.825>you <00:24:36.000>want <00:24:36.175>to <00:24:36.350>use <00:24:36.524>these <00:24:36.700>news

467
00:24:38.800 --> 00:24:41.200
<00:24:38.800>language <00:24:39.080>features <00:24:39.360>at <00:24:39.639>all? <00:24:39.919>What <00:24:40.200>is

468
00:24:41.200 --> 00:24:43.900
<00:24:41.200>a <00:24:41.375>good <00:24:41.550>reason <00:24:41.725>for <00:24:41.900>it <00:24:42.075>so <00:24:42.250>far, <00:24:42.425>I <00:24:42.600>guess.

469
00:24:44.900 --> 00:24:47.300
<00:24:44.900>Who <00:24:45.180>here <00:24:45.460>uses <00:24:45.740>either <00:24:46.020>string <00:24:46.300>or

470
00:24:47.300 --> 00:24:48.600
<00:24:47.300>spring <00:24:47.533>boot? <00:24:47.768>Can <00:24:48.002>I <00:24:48.235>see <00:24:48.469>hence?

471
00:24:49.400 --> 00:24:51.900
<00:24:49.400>Wow, <00:24:49.633>that's <00:24:49.866>an <00:24:50.100>amazing <00:24:50.333>amount <00:24:50.566>of <00:24:50.800>people.

472
00:24:53.200 --> 00:24:56.300
<00:24:53.200>Well <00:24:53.375>as <00:24:53.550>you <00:24:53.725>probably <00:24:53.900>don't <00:24:54.075>know <00:24:54.250>in <00:24:54.425>a <00:24:54.600>third

473
00:24:56.300 --> 00:24:59.400
<00:24:56.300>quarter <00:24:56.427>of <00:24:56.554>this <00:24:56.681>year, <00:24:56.809>we're <00:24:56.936>going <00:24:57.063>to <00:24:57.190>get <00:24:57.318>spring <00:24:57.445>six <00:24:57.572>and <00:24:57.700>spring

474
00:24:59.400 --> 00:25:02.200
<00:24:59.400>boot <00:24:59.680>3 <00:24:59.960>with <00:25:00.240>really <00:25:00.520>cool <00:25:00.800>features.

475
00:25:03.200 --> 00:25:04.500
<00:25:03.200>But <00:25:03.434>you <00:25:03.668>can't <00:25:03.902>use <00:25:04.136>Java <00:25:04.370>8.

476
00:25:05.100 --> 00:25:08.400
<00:25:05.100>You <00:25:05.274>can't <00:25:05.449>just <00:25:05.625>Java <00:25:05.800>11 <00:25:05.975>or <00:25:06.149>16 <00:25:06.324>you <00:25:06.500>have

477
00:25:08.400 --> 00:25:12.000
<00:25:08.400>to <00:25:08.555>use <00:25:08.711>Java <00:25:08.866>17. <00:25:09.022>That's <00:25:09.177>the <00:25:09.333>new <00:25:09.488>Baseline. <00:25:09.644>So <00:25:09.800>Java

478
00:25:11.300 --> 00:25:14.500
<00:25:11.300>17 <00:25:11.500>and <00:25:11.700>they're <00:25:11.899>even <00:25:12.100>saying <00:25:12.300>with <00:25:12.500>newer <00:25:12.700>versions

479
00:25:14.500 --> 00:25:17.500
<00:25:14.500>of <00:25:14.655>spring <00:25:14.811>coming <00:25:14.966>afterwards. <00:25:15.122>They <00:25:15.277>want <00:25:15.433>to <00:25:15.588>keep <00:25:15.744>in <00:25:15.900>sync

480
00:25:17.500 --> 00:25:20.400
<00:25:17.500>with <00:25:17.675>the <00:25:17.850>newest <00:25:18.025>jvm <00:25:18.200>versions. <00:25:18.375>So <00:25:18.550>that's <00:25:18.725>why <00:25:18.900>it's

481
00:25:20.400 --> 00:25:23.600
<00:25:20.400>really <00:25:20.866>important <00:25:21.333>records <00:25:21.800>work

482
00:25:23.600 --> 00:25:26.400
<00:25:23.600>in <00:25:23.879>a <00:25:24.159>certain <00:25:24.439>sense <00:25:24.719>string <00:25:25.000>of

483
00:25:26.400 --> 00:25:30.100
<00:25:26.400>course <00:25:26.600>uses <00:25:26.800>a <00:25:27.000>lot <00:25:27.200>of <00:25:27.400>reflection <00:25:27.600>to <00:25:27.800>create

484
00:25:29.100 --> 00:25:32.100
<00:25:29.100>records. <00:25:29.800>Let's <00:25:30.500>go

485
00:25:32.100 --> 00:25:35.800
<00:25:32.100>to <00:25:32.207>create <00:25:32.315>classes <00:25:32.423>and <00:25:32.530>that's <00:25:32.638>going <00:25:32.746>to <00:25:32.853>be <00:25:32.961>a <00:25:33.069>bit <00:25:33.176>more <00:25:33.284>tricky <00:25:33.392>with <00:25:33.500>records

486
00:25:35.800 --> 00:25:37.700
<00:25:35.800>because <00:25:36.033>that <00:25:36.266>is <00:25:36.500>not <00:25:36.733>going <00:25:36.966>to <00:25:37.200>work.

487
00:25:38.400 --> 00:25:39.500
<00:25:38.400>another <00:25:39.390>limitation

488
00:25:40.400 --> 00:25:43.400
<00:25:40.400>of <00:25:40.575>Records <00:25:40.750>is <00:25:40.925>when <00:25:41.100>using <00:25:41.275>it <00:25:41.450>with <00:25:41.625>jpa <00:25:41.800>because

489
00:25:43.400 --> 00:25:46.700
<00:25:43.400>the <00:25:43.680>Java <00:25:43.960>persistence <00:25:44.240>architected <00:25:44.520>says <00:25:44.800>you

490
00:25:46.700 --> 00:25:49.700
<00:25:46.700>have <00:25:46.933>to <00:25:47.166>have <00:25:47.400>a <00:25:47.633>no <00:25:47.866>Arc <00:25:48.100>Constructor

491
00:25:49.700 --> 00:25:52.400
<00:25:49.700>and <00:25:49.855>that <00:25:50.011>doesn't <00:25:50.166>work <00:25:50.322>with <00:25:50.477>the <00:25:50.633>record. <00:25:50.788>So <00:25:50.944>jpa <00:25:51.100>and

492
00:25:52.400 --> 00:25:53.600
<00:25:52.400>the <00:25:52.616>records <00:25:52.832>that's <00:25:53.048>a <00:25:53.264>no <00:25:53.480>match.

493
00:25:54.800 --> 00:25:57.800
<00:25:54.800>Cool <00:25:54.975>when <00:25:55.149>we <00:25:55.325>are <00:25:55.500>on <00:25:55.675>the <00:25:55.850>records, <00:25:56.024>so <00:25:56.200>is

494
00:25:57.800 --> 00:26:00.100
<00:25:57.800>it <00:25:57.975>possible <00:25:58.149>to <00:25:58.325>use <00:25:58.500>the <00:25:58.675>build <00:25:58.850>pattern <00:25:59.024>on <00:25:59.200>records?

495
00:26:01.300 --> 00:26:04.400
<00:26:01.300>No, <00:26:01.580>it's <00:26:01.860>not. <00:26:02.139>Unfortunately. <00:26:02.419>No, <00:26:02.700>there's

496
00:26:04.400 --> 00:26:05.100
<00:26:04.400>no <00:26:04.715>build <00:26:05.030>pattern.

497
00:26:05.800 --> 00:26:09.500
<00:26:05.800>That's <00:26:06.033>actually <00:26:06.266>a <00:26:06.500>new <00:26:06.733>new <00:26:06.966>language <00:26:07.200>development.

498
00:26:09.500 --> 00:26:12.400
<00:26:09.500>That's <00:26:09.700>just <00:26:09.900>where <00:26:10.100>they're <00:26:10.300>thinking <00:26:10.500>about <00:26:10.700>adding <00:26:10.900>the

499
00:26:12.400 --> 00:26:15.700
<00:26:12.400>build <00:26:12.633>of <00:26:12.866>pattern <00:26:13.100>to <00:26:13.333>records <00:26:13.566>where <00:26:13.800>you

500
00:26:15.700 --> 00:26:19.300
<00:26:15.700>can <00:26:15.980>specify <00:26:16.260>something <00:26:16.540>like <00:26:16.820>something <00:26:17.100>like

501
00:26:19.300 --> 00:26:22.500
<00:26:19.300>let's <00:26:19.533>say <00:26:19.766>in <00:26:20.000>this <00:26:20.233>case <00:26:20.466>conference <00:26:20.700>s

502
00:26:22.500 --> 00:26:25.300
<00:26:22.500>where <00:26:22.627>in <00:26:22.754>the <00:26:22.881>yes, <00:26:23.009>then <00:26:23.136>there's <00:26:23.263>a <00:26:23.390>lot <00:26:23.518>of <00:26:23.645>values <00:26:23.772>that's <00:26:23.900>kind

503
00:26:25.300 --> 00:26:28.400
<00:26:25.300>of <00:26:25.427>a <00:26:25.554>builder <00:26:25.681>pattern, <00:26:25.809>but <00:26:25.936>it <00:26:26.063>was <00:26:26.190>just <00:26:26.318>a <00:26:26.445>suggestion <00:26:26.572>for <00:26:26.700>now.

504
00:26:28.400 --> 00:26:30.900
<00:26:28.400>You <00:26:28.600>can <00:26:28.800>only <00:26:29.000>use <00:26:29.200>the <00:26:29.400>full <00:26:29.600>art <00:26:29.800>Constructor.

505
00:26:31.900 --> 00:26:34.600
<00:26:31.900>Cool <00:26:32.100>cool <00:26:32.300>now <00:26:32.500>a <00:26:32.700>little <00:26:32.900>bit <00:26:33.100>provocative. <00:26:33.300>Well

506
00:26:34.600 --> 00:26:36.700
<00:26:34.600>your <00:26:35.066>thoughts <00:26:35.533>on <00:26:36.000>kotlin.

507
00:26:37.300 --> 00:26:40.400
<00:26:37.300>Ah, <00:26:37.500>yeah, <00:26:37.700>it <00:26:37.899>basically <00:26:38.100>does <00:26:38.300>everything <00:26:38.500>you <00:26:38.700>just

508
00:26:40.400 --> 00:26:40.800
described.

509
00:26:43.400 --> 00:26:46.000
<00:26:43.400>It <00:26:43.575>does <00:26:43.750>it <00:26:43.925>does. <00:26:44.100>Yeah. <00:26:44.275>Yeah <00:26:44.450>and <00:26:44.625>even <00:26:44.800>more.

510
00:26:47.100 --> 00:26:50.200
<00:26:47.100>I <00:26:47.227>I <00:26:47.354>I've <00:26:47.481>been <00:26:47.609>in <00:26:47.736>the <00:26:47.863>same <00:26:47.990>situation <00:26:48.118>just <00:26:48.245>on <00:26:48.372>the <00:26:48.500>other

511
00:26:50.200 --> 00:26:53.700
<00:26:50.200>side <00:26:50.316>of <00:26:50.433>the <00:26:50.550>table <00:26:50.666>where <00:26:50.783>I <00:26:50.900>had <00:26:51.016>to <00:26:51.133>defend <00:26:51.250>kotlin <00:26:51.366>against <00:26:51.483>Java <00:26:51.600>and

512
00:26:53.700 --> 00:26:56.500
<00:26:53.700>I <00:26:53.840>think <00:26:53.980>I <00:26:54.120>won <00:26:54.260>that <00:26:54.400>discussion <00:26:54.540>back <00:26:54.680>then. <00:26:54.820>So <00:26:54.960>yeah, <00:26:55.100>I

513
00:26:56.500 --> 00:27:00.000
<00:26:56.500>can't <00:26:56.655>disagree. <00:26:56.811>It <00:26:56.966>is <00:26:57.122>true. <00:26:57.277>It <00:26:57.433>is <00:26:57.588>true <00:26:57.744>kotlin <00:26:57.900>does

514
00:26:59.300 --> 00:27:02.400
<00:26:59.300>most <00:26:59.766>of <00:27:00.233>now <00:27:00.700>kotlin

515
00:27:02.400 --> 00:27:05.300
<00:27:02.400>does <00:27:02.507>everything <00:27:02.615>Java <00:27:02.723>does <00:27:02.830>and <00:27:02.938>if <00:27:03.046>you <00:27:03.153>look <00:27:03.261>a <00:27:03.369>lot <00:27:03.476>of <00:27:03.584>these <00:27:03.692>features <00:27:03.800>that

516
00:27:05.300 --> 00:27:08.400
<00:27:05.300>they <00:27:05.427>look <00:27:05.554>kind <00:27:05.681>of <00:27:05.809>like <00:27:05.936>stolen <00:27:06.063>but <00:27:06.190>I <00:27:06.318>think <00:27:06.445>we <00:27:06.572>should <00:27:06.700>look

517
00:27:08.400 --> 00:27:12.000
<00:27:08.400>at <00:27:08.527>it <00:27:08.654>in <00:27:08.781>a <00:27:08.909>different <00:27:09.036>light. <00:27:09.163>I <00:27:09.290>think <00:27:09.418>the <00:27:09.545>Java <00:27:09.672>language <00:27:09.800>designers

518
00:27:11.300 --> 00:27:14.500
<00:27:11.300>said, <00:27:11.580>okay. <00:27:11.860>Yeah <00:27:12.139>great. <00:27:12.419>There's <00:27:12.700>Carla

519
00:27:14.500 --> 00:27:17.600
<00:27:14.500>and <00:27:14.675>there's <00:27:14.850>kotlin <00:27:15.025>and <00:27:15.200>that <00:27:15.375>great <00:27:15.550>language, <00:27:15.725>but <00:27:15.900>it

520
00:27:17.600 --> 00:27:20.400
<00:27:17.600>doesn't <00:27:17.774>mean <00:27:17.949>we <00:27:18.125>gonna <00:27:18.300>stop <00:27:18.475>developing <00:27:18.649>Java <00:27:18.824>because <00:27:19.000>still

521
00:27:20.400 --> 00:27:24.100
<00:27:20.400>a <00:27:20.575>lot <00:27:20.750>of <00:27:20.925>companies <00:27:21.100>develop <00:27:21.275>on <00:27:21.450>job. <00:27:21.625>They <00:27:21.800>rely

522
00:27:23.100 --> 00:27:24.700
<00:27:23.100>on <00:27:24.500>Java.

523
00:27:25.300 --> 00:27:28.000
<00:27:25.300>So <00:27:25.475>they <00:27:25.649>are <00:27:25.825>well <00:27:26.000>we <00:27:26.175>gonna <00:27:26.350>it <00:27:26.524>would <00:27:26.700>be

524
00:27:28.300 --> 00:27:31.300
<00:27:28.300>weird <00:27:28.416>if <00:27:28.533>they <00:27:28.649>would <00:27:28.766>suddenly <00:27:28.883>decide. <00:27:29.000>You <00:27:29.116>know, <00:27:29.233>what <00:27:29.350>let's <00:27:29.466>forget <00:27:29.583>it. <00:27:29.700>We

525
00:27:31.300 --> 00:27:34.900
<00:27:31.300>just <00:27:31.407>do <00:27:31.515>the <00:27:31.623>jvm <00:27:31.730>and <00:27:31.838>we <00:27:31.946>don't <00:27:32.053>care <00:27:32.161>about <00:27:32.269>the <00:27:32.376>language <00:27:32.484>anymore <00:27:32.592>because <00:27:32.700>if

526
00:27:34.900 --> 00:27:37.200
<00:27:34.900>you're <00:27:35.040>stuck <00:27:35.180>with <00:27:35.320>your <00:27:35.460>company <00:27:35.600>and <00:27:35.740>they <00:27:35.880>don't <00:27:36.020>want <00:27:36.160>you <00:27:36.300>to

527
00:27:37.200 --> 00:27:40.200
<00:27:37.200>do <00:27:37.327>well <00:27:37.454>you <00:27:37.581>don't <00:27:37.709>want <00:27:37.836>to <00:27:37.963>do <00:27:38.090>Scala <00:27:38.218>your <00:27:38.345>company <00:27:38.472>doesn't <00:27:38.600>want

528
00:27:40.200 --> 00:27:43.500
<00:27:40.200>to <00:27:40.375>do <00:27:40.550>kotlin. <00:27:40.725>So <00:27:40.900>so <00:27:41.075>basically <00:27:41.250>you <00:27:41.425>your <00:27:41.600>Java

529
00:27:43.500 --> 00:27:46.300
<00:27:43.500>and <00:27:43.616>then <00:27:43.733>you <00:27:43.850>want <00:27:43.966>this <00:27:44.083>newer <00:27:44.200>language <00:27:44.316>features, <00:27:44.433>and <00:27:44.550>I <00:27:44.666>think <00:27:44.783>it's <00:27:44.900>cool.

530
00:27:46.300 --> 00:27:47.000
<00:27:46.300>They're <00:27:46.615>getting <00:27:46.930>edit.

531
00:27:47.900 --> 00:27:50.300
<00:27:47.900>I <00:27:48.100>mean <00:27:48.300>that's <00:27:48.500>cool <00:27:48.700>kind <00:27:48.900>of <00:27:49.100>with <00:27:49.300>regards

532
00:27:50.300 --> 00:27:53.200
<00:27:50.300>to <00:27:50.440>the <00:27:50.580>evolution <00:27:50.720>evolution <00:27:50.860>of <00:27:51.000>practically <00:27:51.139>all <00:27:51.280>languages <00:27:51.419>which <00:27:51.560>is <00:27:51.700>happening

533
00:27:53.200 --> 00:27:56.700
<00:27:53.200>kind <00:27:53.375>of <00:27:53.550>now. <00:27:53.725>So <00:27:53.900>you <00:27:54.075>have <00:27:54.250>something <00:27:54.425>Java <00:27:54.600>implementing

534
00:27:56.700 --> 00:27:59.500
<00:27:56.700>from <00:27:56.933>python <00:27:57.166>from <00:27:57.400>kotlin. <00:27:57.633>Yes <00:27:57.866>sharp <00:27:58.100>implementing

535
00:27:59.500 --> 00:28:02.200
<00:27:59.500>from <00:27:59.700>java <00:27:59.900>from <00:28:00.100>Python <00:28:00.300>and <00:28:00.500>all <00:28:00.700>over <00:28:00.900>the

536
00:28:02.200 --> 00:28:05.400
<00:28:02.200>place. <00:28:02.327>I <00:28:02.454>mean, <00:28:02.581>it's <00:28:02.709>important <00:28:02.836>to <00:28:02.963>have <00:28:03.090>an <00:28:03.218>option <00:28:03.345>exactly <00:28:03.472>and <00:28:03.600>look

537
00:28:05.400 --> 00:28:08.500
<00:28:05.400>at <00:28:05.540>kotlin <00:28:05.680>and <00:28:05.820>Swift <00:28:05.960>they <00:28:06.100>basically, <00:28:06.240>you <00:28:06.380>know, <00:28:06.520>they <00:28:06.660>took <00:28:06.800>the

538
00:28:08.500 --> 00:28:11.500
<00:28:08.500>best <00:28:08.655>breeds <00:28:08.811>of <00:28:08.966>languages <00:28:09.122>and <00:28:09.277>all <00:28:09.433>fancy <00:28:09.588>features <00:28:09.744>and <00:28:09.900>stuff

539
00:28:11.500 --> 00:28:14.100
<00:28:11.500>that <00:28:11.655>into <00:28:11.811>a <00:28:11.966>new <00:28:12.122>language. <00:28:12.277>So <00:28:12.433>yeah, <00:28:12.588>but <00:28:12.744>kotlin <00:28:12.900>is

540
00:28:14.100 --> 00:28:14.800
<00:28:14.100>definitely <00:28:14.415>great. <00:28:14.730>Yeah.

541
00:28:15.400 --> 00:28:18.600
<00:28:15.400>Okay, <00:28:15.527>we <00:28:15.654>have <00:28:15.781>time <00:28:15.909>for <00:28:16.036>one <00:28:16.163>or <00:28:16.290>two <00:28:16.418>more. <00:28:16.545>So <00:28:16.672>any <00:28:16.800>changes

542
00:28:18.600 --> 00:28:20.600
<00:28:18.600>regarding <00:28:20.000>JMM?

543
00:28:23.600 --> 00:28:28.200
<00:28:23.600>Well, <00:28:23.833>that's <00:28:24.066>a <00:28:24.300>different <00:28:24.533>topic <00:28:24.766>because <00:28:25.000>jaymen

544
00:28:27.200 --> 00:28:31.200
<00:28:27.200>would <00:28:27.480>jump <00:28:27.760>of <00:28:28.040>course <00:28:28.320>between <00:28:28.600>Java

545
00:28:30.200 --> 00:28:33.600
<00:28:30.200>and <00:28:30.666>12 <00:28:31.133>and <00:28:31.600>17.

546
00:28:33.600 --> 00:28:37.100
<00:28:33.600>They <00:28:33.774>have <00:28:33.949>been <00:28:34.125>a <00:28:34.300>lot <00:28:34.475>of <00:28:34.649>changes <00:28:34.824>to <00:28:35.000>the

547
00:28:37.100 --> 00:28:40.300
<00:28:37.100>garbage <00:28:37.300>collectors. <00:28:37.500>They <00:28:37.699>have <00:28:37.899>actually <00:28:38.100>new <00:28:38.300>Newark <00:28:38.500>garbage

548
00:28:40.300 --> 00:28:43.300
<00:28:40.300>collectors <00:28:40.455>been <00:28:40.611>added <00:28:40.766>and <00:28:40.922>there's <00:28:41.077>also <00:28:41.233>been <00:28:41.388>done <00:28:41.544>a <00:28:41.700>lot

549
00:28:43.300 --> 00:28:44.200
<00:28:43.300>of <00:28:43.705>work <00:28:44.110>to

550
00:28:45.300 --> 00:28:48.200
<00:28:45.300>You <00:28:45.475>know <00:28:45.649>when <00:28:45.825>Javas <00:28:46.000>of <00:28:46.175>when <00:28:46.350>garbage <00:28:46.524>is <00:28:46.700>being

551
00:28:48.200 --> 00:28:51.300
<00:28:48.200>collected <00:28:48.327>so <00:28:48.454>memory <00:28:48.581>is <00:28:48.709>clean. <00:28:48.836>So <00:28:48.963>there's <00:28:49.090>this <00:28:49.218>stop <00:28:49.345>the <00:28:49.472>world <00:28:49.600>phase

552
00:28:51.300 --> 00:28:54.700
<00:28:51.300>where <00:28:51.533>the <00:28:51.766>whole <00:28:52.000>jvm <00:28:52.233>kind <00:28:52.466>of <00:28:52.700>freezes.

553
00:28:55.300 --> 00:28:58.300
<00:28:55.300>memory <00:28:55.475>pointers <00:28:55.649>are <00:28:55.825>being <00:28:56.000>moved <00:28:56.175>around <00:28:56.350>and <00:28:56.524>then <00:28:56.700>it's

554
00:28:58.300 --> 00:29:00.800
<00:28:58.300>unfrozen <00:28:58.649>again, <00:28:59.000>and <00:28:59.350>I <00:28:59.700>think

555
00:29:01.800 --> 00:29:04.400
<00:29:01.800>Don't <00:29:01.927>know <00:29:02.054>the <00:29:02.181>exact <00:29:02.309>figure <00:29:02.436>but <00:29:02.563>I <00:29:02.690>think <00:29:02.818>they're <00:29:02.945>now <00:29:03.072>down <00:29:03.200>to

556
00:29:04.400 --> 00:29:08.300
<00:29:04.400>sub <00:29:04.866>two <00:29:05.333>milliseconds <00:29:05.800>freeze

557
00:29:07.300 --> 00:29:10.300
<00:29:07.300>pause. <00:29:07.475>So <00:29:07.649>that <00:29:07.825>that's <00:29:08.000>really <00:29:08.175>so <00:29:08.350>that's <00:29:08.524>really <00:29:08.700>some

558
00:29:10.300 --> 00:29:13.600
<00:29:10.300>changes <00:29:10.455>done <00:29:10.611>in <00:29:10.766>the <00:29:10.922>garbage <00:29:11.077>collector <00:29:11.233>side. <00:29:11.388>Yes, <00:29:11.544>cool <00:29:11.700>cool.

559
00:29:13.600 --> 00:29:17.000
<00:29:13.600>And <00:29:13.755>the <00:29:13.911>last <00:29:14.066>one <00:29:14.222>which <00:29:14.377>is <00:29:14.533>gonna <00:29:14.688>sound <00:29:14.844>really <00:29:15.000>hard

560
00:29:16.500 --> 00:29:19.100
<00:29:16.500>really? <00:29:16.733>Well, <00:29:16.966>it's <00:29:17.200>not <00:29:17.433>hard <00:29:17.666>question <00:29:17.900>is

561
00:29:19.100 --> 00:29:22.500
<00:29:19.100>just <00:29:19.255>gonna <00:29:19.411>sound <00:29:19.566>hard. <00:29:19.722>It <00:29:19.877>looks <00:29:20.033>like <00:29:20.188>Java <00:29:20.344>is <00:29:20.500>trying

562
00:29:22.500 --> 00:29:24.200
<00:29:22.500>to <00:29:22.850>be <00:29:23.200>more <00:29:23.550>like <00:29:23.900>JavaScript.

563
00:29:25.100 --> 00:29:25.500
Oh.

564
00:29:31.100 --> 00:29:35.500
<00:29:31.100>Well, <00:29:31.255>that's <00:29:31.411>an <00:29:31.566>opinion. <00:29:31.722>I <00:29:31.877>guess. <00:29:32.033>I <00:29:32.188>I <00:29:32.344>think <00:29:32.500>that

565
00:29:35.500 --> 00:29:38.300
<00:29:35.500>that <00:29:35.733>would <00:29:35.966>ask <00:29:36.200>for <00:29:36.433>complete <00:29:36.666>debate <00:29:36.900>with

566
00:29:38.300 --> 00:29:42.100
<00:29:38.300>Java <00:29:38.580>and <00:29:38.860>JavaScript <00:29:39.139>developers. <00:29:39.419>It <00:29:39.700>is

567
00:29:42.100 --> 00:29:45.600
<00:29:42.100>definitely <00:29:42.255>true. <00:29:42.411>Especially <00:29:42.566>if <00:29:42.722>you <00:29:42.877>look <00:29:43.033>at <00:29:43.188>the <00:29:43.344>structuring <00:29:43.500>and

568
00:29:45.600 --> 00:29:48.400
<00:29:45.600>stuff <00:29:45.755>like <00:29:45.911>that <00:29:46.066>that <00:29:46.222>yeah <00:29:46.377>that <00:29:46.533>languages <00:29:46.688>are <00:29:46.844>going <00:29:47.000>together.

569
00:29:48.400 --> 00:29:51.200
<00:29:48.400>But <00:29:48.527>I <00:29:48.654>think <00:29:48.781>that's <00:29:48.909>a <00:29:49.036>really <00:29:49.163>good <00:29:49.290>thing <00:29:49.418>for <00:29:49.545>us <00:29:49.672>developers <00:29:49.800>because

570
00:29:51.200 --> 00:29:54.400
<00:29:51.200>basically <00:29:51.433>sometimes <00:29:51.666>you <00:29:51.900>pick <00:29:52.133>this <00:29:52.366>language <00:29:52.600>because

571
00:29:54.400 --> 00:29:57.300
<00:29:54.400>it <00:29:54.527>had <00:29:54.654>those <00:29:54.781>features <00:29:54.909>and <00:29:55.036>then <00:29:55.163>you <00:29:55.290>picked <00:29:55.418>that <00:29:55.545>language <00:29:55.672>for <00:29:55.800>other

572
00:29:57.300 --> 00:30:00.700
<00:29:57.300>features. <00:29:57.455>I <00:29:57.611>could <00:29:57.766>also <00:29:57.922>say <00:29:58.077>with <00:29:58.233>virtual <00:29:58.388>threats <00:29:58.544>that <00:29:58.700>is

573
00:30:00.700 --> 00:30:03.500
<00:30:00.700>coming <00:30:00.875>to <00:30:01.050>jvm <00:30:01.225>19. <00:30:01.400>Like <00:30:01.575>I <00:30:01.750>said <00:30:01.925>or <00:30:02.100>Java

574
00:30:03.500 --> 00:30:07.500
<00:30:03.500>19. <00:30:03.640>Oh <00:30:03.780>Sunday, <00:30:03.920>it <00:30:04.060>looks <00:30:04.200>like <00:30:04.340>you <00:30:04.480>know, <00:30:04.620>like <00:30:04.760>go <00:30:04.900>routines

575
00:30:07.500 --> 00:30:09.900
<00:30:07.500>and <00:30:07.655>go <00:30:07.811>so <00:30:07.966>maybe <00:30:08.122>it's <00:30:08.277>like <00:30:08.433>that <00:30:08.588>but <00:30:08.744>I <00:30:08.900>think

576
00:30:10.600 --> 00:30:14.100
<00:30:10.600>I <00:30:10.740>think <00:30:10.879>it's <00:30:11.020>really <00:30:11.159>great <00:30:11.300>for <00:30:11.439>us <00:30:11.580>developers <00:30:11.719>that <00:30:11.860>languages <00:30:12.000>get

577
00:30:13.100 --> 00:30:16.200
<00:30:13.100>more <00:30:13.274>and <00:30:13.449>more <00:30:13.625>features. <00:30:13.800>So <00:30:13.975>yeah, <00:30:14.149>they <00:30:14.324>look <00:30:14.500>more

578
00:30:16.200 --> 00:30:19.100
<00:30:16.200>the <00:30:16.300>same. <00:30:16.400>I <00:30:16.500>agree. <00:30:16.600>I <00:30:16.700>agree <00:30:16.800>with <00:30:16.900>you. <00:30:17.000>Let's <00:30:17.100>end <00:30:17.200>up <00:30:17.300>with <00:30:17.400>that. <00:30:17.500>Thank <00:30:17.600>you

579
00:30:19.100 --> 00:30:20.500
<00:30:19.100>so <00:30:19.310>much. <00:30:19.520>Thank <00:30:19.730>you <00:30:19.940>very <00:30:20.150>much. <00:30:20.360>Continue.