1 00:00:00,610 --> 00:00:07,370 The objective of our program is to evaluate if some expressions are true or false. 2 00:00:07,570 --> 00:00:14,560 So basically in the client application here, in the main main method, we have a few callers define 3 00:00:14,560 --> 00:00:20,410 us terminal expressions and we evaluate if those cards are either fast or reliable. 4 00:00:21,190 --> 00:00:22,210 Let's take a look. 5 00:00:22,990 --> 00:00:26,230 Before we execute this, let's take a look at the abstractions. 6 00:00:26,230 --> 00:00:32,950 So we have defined here in abstract class called abstract expression, which has only one method called 7 00:00:32,950 --> 00:00:36,430 interpret, which accepts a pair of tight strings. 8 00:00:37,000 --> 00:00:42,380 This abstract class is implemented in two classes. 9 00:00:42,970 --> 00:00:44,340 Actually, there are three classes. 10 00:00:44,350 --> 00:00:48,030 So let's start first with the terminal expression class. 11 00:00:48,790 --> 00:00:58,150 So this one has the interpreted method here where you verify basically if the context that we give as 12 00:00:58,150 --> 00:01:06,090 a string contains the data that is used to that is used to initialize this class with. 13 00:01:06,550 --> 00:01:08,350 So if yes, it will return true. 14 00:01:08,350 --> 00:01:10,000 If no, it will return false. 15 00:01:10,250 --> 00:01:16,660 And similarly, we have this almost the same implementation for any and all expressions. 16 00:01:16,900 --> 00:01:21,520 But we basically here have two expressions that we need to evaluate. 17 00:01:21,760 --> 00:01:27,490 And if both expressions are true, then two will be outputted here. 18 00:01:27,760 --> 00:01:35,470 And four or basically if one of these expressions is true, then two will be outputted. 19 00:01:35,470 --> 00:01:37,820 Otherwise it will be equal to two. 20 00:01:38,020 --> 00:01:44,320 So basically we have end more operations here defined as expressions. 21 00:01:44,770 --> 00:01:53,980 So in the client class here in in the main method, we have two terminal expressions that we defined 22 00:01:54,190 --> 00:02:01,860 as being equal to two cars and is fast expression is another expression. 23 00:02:01,870 --> 00:02:08,920 So either one of these two cars will be will be equal to Toyota or Lexus. 24 00:02:09,430 --> 00:02:11,890 The old expression will return. 25 00:02:11,890 --> 00:02:12,210 True. 26 00:02:12,700 --> 00:02:23,590 So the same is applicable for reliabilities and car number three and the reliable parameter, the reliable 27 00:02:23,590 --> 00:02:32,230 string will be evaluated in a single expression using anend operator, then this will be returning. 28 00:02:32,230 --> 00:02:32,580 True. 29 00:02:32,770 --> 00:02:34,480 So let's see this in action. 30 00:02:36,580 --> 00:02:47,410 So as you can see, there is fast method, these fast expression here when interpreting the Toyota string 31 00:02:47,410 --> 00:02:56,260 will output through, whereas there is reliable expression, if it will have to interpret reliable Komsomolskaya 32 00:02:56,260 --> 00:02:57,820 Mazda, it will output through. 33 00:02:57,820 --> 00:02:59,350 Otherwise it will output fall. 34 00:02:59,390 --> 00:03:06,580 So let's let's create a new condition here to output the false statement. 35 00:03:06,790 --> 00:03:08,530 So let's put here Lexus. 36 00:03:12,100 --> 00:03:18,580 So as you can see, this expression here is validated as being false, so it's not valid according to 37 00:03:18,820 --> 00:03:21,610 this implementation of this program. 38 00:03:22,390 --> 00:03:24,680 That's it for this tutorial. 39 00:03:24,700 --> 00:03:29,820 Join me in the next video where we are going to discuss about Detroiter Catherine.