1
00:00:00,350 --> 00:00:01,000
OK.

2
00:00:01,350 --> 00:00:08,790
But if both of these boolean expressions are true or if both of these boolean expressions are far less

3
00:00:09,200 --> 00:00:13,100
this logical operator produces a false value.

4
00:00:13,110 --> 00:00:13,730
OK.

5
00:00:13,860 --> 00:00:19,110
So for example if I want to actually change this value to something else for example.

6
00:00:19,350 --> 00:00:22,880
Now that is less than or equal to 69.

7
00:00:23,400 --> 00:00:31,950
And if I change this value for example to 78 as you can see here now it's can actually again output

8
00:00:32,250 --> 00:00:34,050
the value true to the console.

9
00:00:34,050 --> 00:00:40,350
So let's actually run our project as you can see it's not actually the value tool is now output to the

10
00:00:40,350 --> 00:00:40,930
console.

11
00:00:41,100 --> 00:00:46,950
Because this expression as you can see here this expression evaluates to TRUE.

12
00:00:47,010 --> 00:00:47,700
OK.

13
00:00:48,000 --> 00:00:52,320
As you can see the value of the non-fun valuable is less than sixty nine.

14
00:00:52,480 --> 00:01:00,510
OK so the value of the number one variable is 59 and 59 is less than 69.

15
00:01:00,540 --> 00:01:02,580
So this expression evaluates to TRUE.

16
00:01:02,730 --> 00:01:05,640
OK on this expression here.

17
00:01:05,880 --> 00:01:11,790
Evaluate to false OK the value of the number one variable is not greater than 78.

18
00:01:11,850 --> 00:01:12,830
OK.

19
00:01:13,210 --> 00:01:18,360
59 is not greater than 78 59 is less than 78.

20
00:01:18,420 --> 00:01:26,010
So this expression here evaluates to false as a result the value of the entire expression evaluates

21
00:01:26,010 --> 00:01:26,580
to true.

22
00:01:26,580 --> 00:01:33,180
Now we're not talking about another type of logical operator the not logical operator OK not logical

23
00:01:33,210 --> 00:01:34,800
operator so.

24
00:01:35,160 --> 00:01:40,410
So in order to use the not logical operator in our Java code views design in our code.

25
00:01:40,410 --> 00:01:40,890
OK.

26
00:01:41,130 --> 00:01:44,900
Just place and shift key plus the number one key on your keyboard.

27
00:01:44,910 --> 00:01:45,530
OK.

28
00:01:45,840 --> 00:01:46,860
As you can see.

29
00:01:47,040 --> 00:01:53,880
So in order to use the not logical operator in your Java code we use this symbol this logical operator

30
00:01:54,150 --> 00:02:01,920
reverses the value of the boolean expression in the same way that a minus sign reverses the positive

31
00:02:01,980 --> 00:02:03,990
or negative sign on a number.

32
00:02:04,060 --> 00:02:07,020
OK so now let me show you some real examples.

33
00:02:07,020 --> 00:02:07,720
OK.

34
00:02:07,740 --> 00:02:14,700
So the data type of my variable is int and the name of my variable is first number.

35
00:02:15,260 --> 00:02:15,670
OK.

36
00:02:15,690 --> 00:02:18,000
And then I want to assign a value to my variable.

37
00:02:18,000 --> 00:02:19,450
For example 25.

38
00:02:19,460 --> 00:02:26,070
So now I want to create another boolean variable so the data type of my variable is boolean and the

39
00:02:26,070 --> 00:02:27,570
name of multivariable is.

40
00:02:27,570 --> 00:02:32,020
For example can get our job.

41
00:02:32,660 --> 00:02:33,190
OK.

42
00:02:33,210 --> 00:02:36,820
And then I assign a value to my valuable for example follows.

43
00:02:37,320 --> 00:02:40,790
And then at the end of my statement I need to put in a semi-colon OK.

44
00:02:41,100 --> 00:02:45,790
So now I want to change the value of these boolean value here.

45
00:02:45,810 --> 00:02:51,900
So I just need to refer to the name of my variable and get a job and then I want to assign a value to

46
00:02:51,900 --> 00:02:52,770
my variable.

47
00:02:52,920 --> 00:02:55,960
So here I want to actually use that expression.

48
00:02:56,100 --> 00:02:56,870
OK.

49
00:02:57,060 --> 00:03:01,380
I just need to put in prentices and that inside Apprentice's I can with the expression.

50
00:03:01,380 --> 00:03:01,920
OK.

51
00:03:02,190 --> 00:03:03,910
So.

52
00:03:04,170 --> 00:03:10,280
So I want to actually refer to the name of my first number variable in order to read its value.

53
00:03:10,320 --> 00:03:14,270
So as you can see here I use the capital T here.

54
00:03:14,280 --> 00:03:15,010
This is wrong.

55
00:03:15,090 --> 00:03:18,520
Ok I need to use the lowercase letter.

56
00:03:18,750 --> 00:03:22,790
OK because this letter is part of my first word.

57
00:03:22,800 --> 00:03:23,410
OK.

58
00:03:23,640 --> 00:03:29,670
So here I need to refer to the name of my variable in order to read its value first number.

59
00:03:29,670 --> 00:03:35,730
Now I want to tell the computer that first number must be less than 50.

60
00:03:36,060 --> 00:03:36,360
OK.

61
00:03:36,360 --> 00:03:40,040
And then at the end of my statement I need to put in a semi-colon OK.

62
00:03:40,050 --> 00:03:46,990
So now I ventured out with the value of this variable to the concert system that out that princeling

63
00:03:48,420 --> 00:03:53,390
and and inside the apprentice's I need to refer to the name of my variable I can get a job.

64
00:03:53,400 --> 00:03:54,150
OK.

65
00:03:54,360 --> 00:03:57,960
And then at the end of my statement I need to put in a semi-colon.

66
00:03:58,260 --> 00:04:03,090
So if I run my project now as you can see it outputs this value to the console.

67
00:04:03,090 --> 00:04:03,670
True.

68
00:04:03,900 --> 00:04:07,460
OK this value is the value of this can get a job value of it.

69
00:04:07,500 --> 00:04:10,530
OK so this expression here evaluates to TRUE.

70
00:04:10,530 --> 00:04:11,210
Why.

71
00:04:11,250 --> 00:04:17,450
Because the value of the first number value is 25 and 25 is less than 50.

72
00:04:17,610 --> 00:04:20,480
OK so this expression evaluates to true.

73
00:04:20,490 --> 00:04:23,670
So now I want to use the not operator here.

74
00:04:23,670 --> 00:04:29,990
So in order to use the not operator in our code we need to put the not operator before the boolean expression.

75
00:04:30,030 --> 00:04:32,910
So as you can see this is our boolean expression.

76
00:04:32,910 --> 00:04:35,550
Now I want to put another operator here.

77
00:04:35,550 --> 00:04:41,610
So now let me actually run my project as you can see this value is now false.

78
00:04:41,640 --> 00:04:45,830
OK the value of false is now out with her to the console.

79
00:04:45,870 --> 00:04:55,890
So the not operator reverses the value of a boolean expression in the same way that the minus sign reverses

80
00:04:56,070 --> 00:04:58,850
the positive or negative sign on a number.

81
00:04:59,000 --> 00:05:04,360
OK as you can see not operator reverses the value of this expression.

82
00:05:04,360 --> 00:05:07,950
So for example as you can see first number is less than 50.

83
00:05:08,010 --> 00:05:12,730
So this expression evaluates to TRUE OK but this not operator here.

84
00:05:12,840 --> 00:05:16,000
Rivera says that the true value to false value.

85
00:05:16,020 --> 00:05:16,860
OK.

86
00:05:17,040 --> 00:05:21,240
And that's why you see the first value is output to the console.

87
00:05:21,240 --> 00:05:26,910
So for example if I now change this value here to 20 as you can see.

88
00:05:26,970 --> 00:05:30,240
So now let me actually run my project and see what happens.

89
00:05:30,270 --> 00:05:33,590
The value of that is output to the console is true.

90
00:05:33,600 --> 00:05:34,910
So what's going on here.

91
00:05:34,920 --> 00:05:42,360
So let me explain to you once again as you can see this expression here evaluates to false the value

92
00:05:42,360 --> 00:05:45,270
of the first number variable is 25.

93
00:05:45,290 --> 00:05:48,850
OK so 25 is not less than 20.

94
00:05:48,900 --> 00:05:58,140
So the value of this entire expression evaluates to false but this not operator here that reverses the

95
00:05:58,140 --> 00:06:00,240
value of a boolean expression.

96
00:06:00,450 --> 00:06:05,970
Ok this not operator reverses that false value to true value.

97
00:06:05,970 --> 00:06:06,840
True Value.

98
00:06:06,850 --> 00:06:11,040
So that's why we see the true value here in the console.

99
00:06:11,100 --> 00:06:12,200
OK.

100
00:06:12,240 --> 00:06:13,800
So this is very important.

101
00:06:13,800 --> 00:06:18,010
So now if I for example change this number to 50.

102
00:06:18,150 --> 00:06:19,860
Now let me run my project.

103
00:06:19,860 --> 00:06:23,040
So as you can see the value falls out with at the console.

104
00:06:23,090 --> 00:06:26,470
OK first number is less than 30.

105
00:06:26,550 --> 00:06:33,500
So this expression evaluates to TRUE okay and does not operate operator reverses that true value to

106
00:06:33,510 --> 00:06:34,440
false value.

107
00:06:34,440 --> 00:06:38,290
So now let me actually change this number two for example 10.

108
00:06:38,310 --> 00:06:42,450
So as you can see here the value true is outputted to the console.

109
00:06:42,530 --> 00:06:43,050
Okay.

110
00:06:43,110 --> 00:06:45,840
So this expression here evaluates to false.

111
00:06:45,840 --> 00:06:46,450
Okay.

112
00:06:46,710 --> 00:06:51,170
The value of this first number variable 25 is not less than 10.

113
00:06:51,330 --> 00:06:51,930
Okay.

114
00:06:52,110 --> 00:07:00,330
So this expression evaluates to false and this operator reverses that false value to true value.

115
00:07:00,330 --> 00:07:01,210
Okay.

116
00:07:01,530 --> 00:07:06,790
So that's why we see these are true value in the console Okay.

117
00:07:07,050 --> 00:07:10,490
So I think that's enough for this theater.

118
00:07:10,830 --> 00:07:14,610
And if you have any question please post the discussion in the course.

119
00:07:14,640 --> 00:07:20,430
So thank you very much for watching this tutorial and I'll see you in the next tutorial.

