1
00:00:00,210 --> 00:00:07,560
Now if you want to actually create another variable for example in that age and then I put in an assignment

2
00:00:07,590 --> 00:00:12,850
operator here and then I can assign a value to my valuable for example 35.

3
00:00:12,870 --> 00:00:13,470
OK.

4
00:00:13,650 --> 00:00:17,360
And then at the end of my statement I need to put in a semi-colon.

5
00:00:17,460 --> 00:00:23,750
So now we want to output the value of this variable to the console to make sure that it works OK.

6
00:00:24,300 --> 00:00:30,090
And then inside Apprentice's I need to refer to the name of my variable and then at the end of my statement

7
00:00:30,420 --> 00:00:32,500
I need to put in a semi-colon OK.

8
00:00:32,850 --> 00:00:38,130
So now if I run my project as you can see this value is now output to the console.

9
00:00:38,190 --> 00:00:46,440
OK this value is the value of my age variable and in line 41 I decided to output the value of my age

10
00:00:46,440 --> 00:00:47,530
variable to the console.

11
00:00:47,520 --> 00:00:48,110
OK.

12
00:00:48,300 --> 00:00:56,370
So now you want to actually create another variable boolean and the name of my variable would be can

13
00:00:57,030 --> 00:00:59,820
play football.

14
00:01:00,580 --> 00:01:01,280
OK.

15
00:01:01,350 --> 00:01:04,440
And then I can assign a value to my variable here.

16
00:01:04,590 --> 00:01:07,660
For example false or true.

17
00:01:07,920 --> 00:01:08,530
OK.

18
00:01:08,790 --> 00:01:12,680
And then at the end of my statement I need to put in a semicolon OK.

19
00:01:12,930 --> 00:01:18,600
So now if you want to output the value of this variable to the console I just need to type in her system

20
00:01:18,600 --> 00:01:25,290
that out that print's land and then inside the prentices I need to refer to the name of my valuable

21
00:01:25,650 --> 00:01:28,140
Channa play football.

22
00:01:28,440 --> 00:01:32,100
And at the end of my statement I need to put in a semi-colon OK.

23
00:01:32,370 --> 00:01:38,490
So now if I run my project as you can see it outputs the value of these can play with Paul variable

24
00:01:38,490 --> 00:01:39,090
to the console.

25
00:01:39,120 --> 00:01:44,950
OK so now I want to actually use the all logical operator here for my expressions.

26
00:01:44,970 --> 00:01:45,510
OK.

27
00:01:45,720 --> 00:01:49,100
I want to actually assign another value to my boolean value.

28
00:01:49,140 --> 00:01:51,670
So I just need to refer to the name of my value.

29
00:01:51,700 --> 00:01:53,060
Well OK.

30
00:01:53,340 --> 00:01:56,530
And then you want to assign a value to my value of it.

31
00:01:56,580 --> 00:01:59,430
So here I want to actually combine expressions together.

32
00:01:59,430 --> 00:02:07,420
So the first expression is for example the age must be less than 50.

33
00:02:07,730 --> 00:02:08,600
OK.

34
00:02:09,060 --> 00:02:17,310
And then I use the OR operator press on shift key plus the slash key on your keyboard two times.

35
00:02:17,310 --> 00:02:21,570
So as you can see this is the or logical operator that we use in Java.

36
00:02:21,570 --> 00:02:22,420
OK.

37
00:02:22,980 --> 00:02:27,220
And now I want to actually create an other expression.

38
00:02:27,510 --> 00:02:34,710
So I just put in practices here and then inside the practices I tell the computer that the age must

39
00:02:34,710 --> 00:02:37,390
be greater than 20.

40
00:02:37,710 --> 00:02:38,250
OK.

41
00:02:38,370 --> 00:02:42,170
And then at the end of my statement I need to put in a semi-colon OK.

42
00:02:42,630 --> 00:02:47,940
So now if I want to output the value of this variable to the console Let's see what happens.

43
00:02:48,040 --> 00:02:55,060
System that out that print and and an inside Apprentice's.

44
00:02:55,200 --> 00:03:00,730
I just need to refer to the name of my variable can play football.

45
00:03:00,780 --> 00:03:01,240
OK.

46
00:03:01,290 --> 00:03:04,670
And then at the end of my statement I need to put in a semicolon.

47
00:03:04,670 --> 00:03:05,250
OK.

48
00:03:05,550 --> 00:03:12,420
So if you run my project now as you can see it outputs this value to the console so they don't actually

49
00:03:12,420 --> 00:03:15,190
comment out these lines of code here.

50
00:03:16,260 --> 00:03:22,630
And if I run my project again as you can see it outputs the value of my hand play football variable

51
00:03:22,680 --> 00:03:23,430
to the concert.

52
00:03:23,430 --> 00:03:27,050
So as you can see here this expression here evaluates to TRUE.

53
00:03:27,060 --> 00:03:27,610
Why.

54
00:03:27,720 --> 00:03:31,730
Because the value of the H variable is less than 30.

55
00:03:32,040 --> 00:03:36,720
So as you can see here the value of the age variable is 45.

56
00:03:36,720 --> 00:03:37,380
OK.

57
00:03:37,380 --> 00:03:45,060
And here I am telling the computer that the value of the H variable must be less than 30.

58
00:03:45,210 --> 00:03:49,160
In order to evaluate the value of this expression true true.

59
00:03:49,230 --> 00:03:49,850
OK.

60
00:03:49,920 --> 00:03:53,200
And here I am using the OR operator OK.

61
00:03:53,370 --> 00:03:58,960
As you can see here this expression combines two comparison expressions.

62
00:03:59,820 --> 00:04:04,860
H must be less than 50 or H must be greater than 20.

63
00:04:04,860 --> 00:04:05,430
OK.

64
00:04:05,610 --> 00:04:06,200
OK.

65
00:04:06,240 --> 00:04:14,460
So if either of these expressions is true the boolean value true is assigned to the variable can play

66
00:04:14,460 --> 00:04:15,000
football.

67
00:04:15,090 --> 00:04:15,700
OK.

68
00:04:15,780 --> 00:04:24,870
Only if both of these expressions are false is the value of false assigned assigned to play football.

69
00:04:24,970 --> 00:04:25,430
You bet.

70
00:04:25,440 --> 00:04:34,800
OK so now let me actually show you the result as you can see here the value true is now out with it

71
00:04:35,040 --> 00:04:35,870
to the console.

72
00:04:35,970 --> 00:04:36,550
OK.

73
00:04:36,780 --> 00:04:39,480
So now let me actually explain what's going on here.

74
00:04:39,480 --> 00:04:39,960
OK.

75
00:04:40,030 --> 00:04:44,450
In Line 50 we created a value but AK ain't age.

76
00:04:44,640 --> 00:04:46,970
And to be assigned a value to a variable.

77
00:04:47,010 --> 00:04:47,520
OK.

78
00:04:47,580 --> 00:04:57,600
In line 52 we created another variable can play football with the boolean data type and we assigned

79
00:04:57,660 --> 00:04:59,680
the value true to our value but.

80
00:04:59,820 --> 00:05:05,860
And in line 35 I decided to change the value of the can play football valuable.

81
00:05:05,880 --> 00:05:06,320
OK.

82
00:05:06,330 --> 00:05:13,380
So as you can see here in line first if I put a combination of expressions as you can see here as a

83
00:05:13,380 --> 00:05:14,890
value for my variable.

84
00:05:14,940 --> 00:05:15,580
OK.

85
00:05:15,660 --> 00:05:20,870
So the first expression is 8 must be less than 30.

86
00:05:21,070 --> 00:05:24,450
OK the value of the H variable is 35.

87
00:05:24,500 --> 00:05:24,860
OK.

88
00:05:24,870 --> 00:05:25,820
As you can see here.

89
00:05:25,830 --> 00:05:31,920
So I am telling the computer that the value of the H variable must be less than 50.

90
00:05:31,980 --> 00:05:40,890
In order to evaluate the value of this expression to true and here I am using the OR operator or the

91
00:05:40,890 --> 00:05:44,580
value of the A2 variable must be greater than 20.

92
00:05:44,580 --> 00:05:44,980
OK.

93
00:05:45,000 --> 00:05:52,870
So as you can see here the value of the H variable is 55 35 is not less than 40.

94
00:05:52,980 --> 00:05:55,420
So this expression evaluates to false.

95
00:05:55,440 --> 00:05:59,220
Ok so now let me actually create a comment here.

96
00:05:59,220 --> 00:06:02,480
This expression here evaluates to false.

97
00:06:02,480 --> 00:06:03,250
Why.

98
00:06:03,270 --> 00:06:07,180
Because the value of the age variable is greater than 50.

99
00:06:07,320 --> 00:06:09,580
OK so false.

100
00:06:10,070 --> 00:06:10,730
OK.

101
00:06:11,070 --> 00:06:14,760
And here I am using the OR operator or.

102
00:06:15,590 --> 00:06:16,350
OK.

103
00:06:16,740 --> 00:06:20,050
And the value of the expression evaluates to TRUE.

104
00:06:20,220 --> 00:06:20,490
OK.

105
00:06:20,490 --> 00:06:25,130
Because the value of the age of the bell is greater than 20.

106
00:06:25,400 --> 00:06:26,170
OK.

107
00:06:26,190 --> 00:06:31,890
The value of the age variable is 45 and 35 is greater than 20.

108
00:06:32,010 --> 00:06:39,180
So the value of this expression evaluates to true and because I am using the old operator here if either

109
00:06:39,210 --> 00:06:41,120
of these expressions is true.

110
00:06:41,150 --> 00:06:41,590
OK.

111
00:06:41,730 --> 00:06:46,760
The boolean value truth is assigned to the variable can play football.

112
00:06:46,770 --> 00:06:47,350
OK.

113
00:06:47,490 --> 00:06:49,640
So this expression evaluates to TRUE.

114
00:06:49,650 --> 00:06:50,370
OK.

115
00:06:50,790 --> 00:06:58,550
As a result the entire expression evaluates to true and that's true value will be assigned to this can

116
00:06:58,560 --> 00:06:59,610
play football valuable.

117
00:06:59,610 --> 00:07:00,190
OK.

118
00:07:00,450 --> 00:07:09,510
So if I for example change this value to 40 and if I run my project now as you can see it's going to

119
00:07:09,510 --> 00:07:13,290
output the value of this variable to the council for us.

120
00:07:13,400 --> 00:07:14,150
OK.

121
00:07:14,530 --> 00:07:18,680
This fall this is the value of this can can play football valuable.

122
00:07:18,960 --> 00:07:26,670
So as you can see here this is this expression evaluates to false OK or this expression again evaluates

123
00:07:26,670 --> 00:07:28,440
to false as a result.

124
00:07:28,440 --> 00:07:33,470
The entire expression evaluates to false and that false value is assigned.

125
00:07:33,610 --> 00:07:35,850
Two can play football very well.

126
00:07:36,130 --> 00:07:38,950
And here as you can see this is that value OK.

127
00:07:39,150 --> 00:07:48,360
And here if I for example change this value to 42 as you can see here this expression now evaluates

128
00:07:48,360 --> 00:07:48,810
to TRUE.

129
00:07:48,810 --> 00:07:54,590
OK because the value of this age variable is now less than 42.

130
00:07:54,720 --> 00:07:55,380
OK.

131
00:07:55,640 --> 00:07:57,730
45 is less than 42.

132
00:07:57,870 --> 00:08:01,970
So this expression evaluates to true or as you can see here.

133
00:08:01,980 --> 00:08:05,830
Again I am using the OR operator the all logical operator here.

134
00:08:05,940 --> 00:08:09,310
Here as you can see this expression evaluates to false.

135
00:08:09,510 --> 00:08:16,130
So if I on my project as you can see because this expression evaluates to true that's enough.

136
00:08:16,140 --> 00:08:20,160
So now you can see here this expression evaluates to TRUE.

137
00:08:20,280 --> 00:08:24,310
OK all this expression evaluates to false.

138
00:08:24,330 --> 00:08:24,970
OK.

139
00:08:25,110 --> 00:08:29,610
So as you can see if I run on my project as you can see this value is now out with it to the console

140
00:08:30,120 --> 00:08:35,930
because when you are using an all logical operator between your expressions.

141
00:08:35,990 --> 00:08:36,570
OK.

142
00:08:36,660 --> 00:08:40,980
It is enough that only one of your expressions evaluate to true.

143
00:08:41,040 --> 00:08:41,580
OK.

144
00:08:41,580 --> 00:08:46,230
And as a result the entire expression evaluates to true.

145
00:08:46,230 --> 00:08:52,050
Now let me actually change this number two for example for the fourth.

146
00:08:52,200 --> 00:08:52,970
OK.

147
00:08:53,250 --> 00:09:00,370
Now as you can see this expression evaluates to true age must be greater than the first four.

148
00:09:00,540 --> 00:09:04,410
So as you can see here the value of my age variable is 55.

149
00:09:04,470 --> 00:09:11,580
And here I am telling the computer that the value of the age value of it must be greater than 44 in

150
00:09:11,580 --> 00:09:14,880
order to evaluate the value of this expression neutral.

151
00:09:14,930 --> 00:09:15,460
OK.

152
00:09:15,480 --> 00:09:18,080
And this expression again evaluates to true.

153
00:09:18,270 --> 00:09:23,590
And if I run my project now as you can see again it's going to output this value to the console.

154
00:09:23,610 --> 00:09:24,000
OK.

155
00:09:24,000 --> 00:09:28,180
But when you are using the and operator there is a different story.

156
00:09:28,200 --> 00:09:28,890
OK.

157
00:09:28,890 --> 00:09:34,850
All of your expressions must evaluate to true in order to evaluate the entire expression.

158
00:09:34,900 --> 00:09:35,410
True.

159
00:09:35,520 --> 00:09:39,350
OK that's enough for this or logical OPERATOR OK.

