1
00:00:00,440 --> 00:00:05,620
Hire everyone in this theater here I'm going to talk about comparisons OK.

2
00:00:05,880 --> 00:00:08,650
So first we need to create a Java project.

3
00:00:08,790 --> 00:00:13,740
So just click on this find new and then click on Java project.

4
00:00:13,740 --> 00:00:14,580
OK.

5
00:00:14,640 --> 00:00:17,450
So for the project name just type in here.

6
00:00:17,730 --> 00:00:18,600
Comparison's

7
00:00:21,410 --> 00:00:22,160
OK.

8
00:00:22,420 --> 00:00:24,050
And click on finish.

9
00:00:24,250 --> 00:00:27,560
So as you can see here our project is now created.

10
00:00:27,790 --> 00:00:30,520
So we need a class for our project.

11
00:00:30,550 --> 00:00:38,720
So just click on this as our See folder and then click on File new and click on class.

12
00:00:38,740 --> 00:00:39,700
OK.

13
00:00:40,300 --> 00:00:44,780
So for the class name just type in here comparison.

14
00:00:46,560 --> 00:00:49,230
And for the package name we need it.

15
00:00:49,240 --> 00:00:54,160
The worst domain here you just type in here com dot your name.

16
00:00:54,340 --> 00:00:54,960
OK.

17
00:00:55,150 --> 00:00:59,670
And at the end of your package name just put that project name.

18
00:00:59,680 --> 00:01:00,790
OK comparison's

19
00:01:05,330 --> 00:01:06,610
for the modifiers.

20
00:01:06,740 --> 00:01:07,680
Choose public.

21
00:01:07,730 --> 00:01:12,940
And make sure that you take the check box here that says public static void main effort.

22
00:01:12,950 --> 00:01:13,620
OK.

23
00:01:13,790 --> 00:01:17,880
This is going to be our starting point for running our Java code.

24
00:01:17,900 --> 00:01:18,540
OK.

25
00:01:18,710 --> 00:01:20,200
And then click on finish.

26
00:01:20,450 --> 00:01:23,400
So as you can see here our class is now created.

27
00:01:23,570 --> 00:01:26,250
So first let me actually it's this comment here.

28
00:01:26,450 --> 00:01:32,340
So in order to make this a little area of Vider you need to actually double click on this comparison

29
00:01:32,360 --> 00:01:33,550
Dutch over top here.

30
00:01:33,620 --> 00:01:36,860
And as you can see this entire area is now much wider.

31
00:01:36,860 --> 00:01:37,810
OK.

32
00:01:37,880 --> 00:01:44,570
And in order to make this a little area smaller You just need to actually double click and these are

33
00:01:44,570 --> 00:01:46,190
comparisons that Jobar had here.

34
00:01:46,190 --> 00:01:47,030
OK.

35
00:01:47,300 --> 00:01:50,940
So now I want to actually write some code here.

36
00:01:51,020 --> 00:01:51,560
OK.

37
00:01:51,590 --> 00:01:55,130
So as you know I want to talk about comparisons.

38
00:01:55,160 --> 00:02:03,740
Java has several operators for making any comparisons and variables variables and literals or other

39
00:02:03,740 --> 00:02:05,950
types of information in a program.

40
00:02:06,000 --> 00:02:13,570
OK these operators are used in expressions that return boolean values of true or false.

41
00:02:13,610 --> 00:02:19,180
Ok so now let me actually show you some real examples in order to make this concept more clear for you.

42
00:02:19,190 --> 00:02:19,640
OK.

43
00:02:19,700 --> 00:02:25,740
Now I want to create some variables here the data type of my variable is boolean.

44
00:02:26,120 --> 00:02:28,360
The name of my variable is.

45
00:02:28,370 --> 00:02:31,790
For example if you want.

46
00:02:32,900 --> 00:02:35,390
And then I assign a value to my variable.

47
00:02:35,480 --> 00:02:36,330
False.

48
00:02:36,580 --> 00:02:37,090
OK.

49
00:02:37,190 --> 00:02:40,410
So at the end of your statement you need to put in a semi-colon.

50
00:02:40,440 --> 00:02:41,010
OK.

51
00:02:41,240 --> 00:02:48,710
And I want to create another variable here in the name of my value is 8 and I want to assign a value

52
00:02:48,710 --> 00:02:49,320
to my.

53
00:02:49,400 --> 00:02:51,090
For example 25.

54
00:02:51,170 --> 00:02:53,940
So now I want to actually make a comparison here.

55
00:02:53,990 --> 00:02:58,420
So I just need to refer to the name of my boolean variable.

56
00:02:58,610 --> 00:02:59,610
Is.

57
00:03:00,130 --> 00:03:01,110
OK.

58
00:03:01,490 --> 00:03:09,200
And then I just type in here h less than 50 and then at the end of my statement I need to put in a semi-colon

59
00:03:09,200 --> 00:03:09,860
OK.

60
00:03:10,250 --> 00:03:19,450
So first let me actually output the value of these variables to the console system that out that princeling.

61
00:03:19,940 --> 00:03:25,550
And then inside Apprentice's I just need to refer to the name of my variable is young and at the end

62
00:03:25,550 --> 00:03:28,190
of my statement I need to put in a semicolon.

63
00:03:28,460 --> 00:03:36,890
And here again I want to actually output the value of this h variable to the console system that's out

64
00:03:37,040 --> 00:03:39,200
that princeling.

65
00:03:39,890 --> 00:03:44,660
And then inside Apprentice's I need to refer to the name of my valuable which is age.

66
00:03:44,660 --> 00:03:45,190
OK.

67
00:03:45,320 --> 00:03:50,290
And here I want to output the value of this easy and variable to the console.

68
00:03:50,290 --> 00:03:50,690
OK.

69
00:03:50,810 --> 00:03:59,600
So a system that out that print to learn and then inside Apprentice's I just need to refer to the name

70
00:03:59,600 --> 00:04:01,370
of my Yahn qualia.

71
00:04:01,400 --> 00:04:02,700
OK.

72
00:04:03,650 --> 00:04:06,740
And then at the end of my statement you need to put in a semicolon.

73
00:04:07,130 --> 00:04:15,190
So if you are on my project now as you can see it's going to actually output these values to the console

74
00:04:15,190 --> 00:04:15,800
OK.

75
00:04:16,040 --> 00:04:17,990
So the first value is false.

76
00:04:18,080 --> 00:04:18,360
OK.

77
00:04:18,380 --> 00:04:23,080
As you can see I assigned the false value to my boolean variable here.

78
00:04:23,090 --> 00:04:23,700
OK.

79
00:04:23,900 --> 00:04:31,690
And in line 14 I decided to output the value of this variable to the concert which is false OK in line

80
00:04:31,700 --> 00:04:32,640
16.

81
00:04:32,650 --> 00:04:40,850
Are you declared the age variable and I assigned the value 25 to my variable and in line 17 I decided

82
00:04:40,850 --> 00:04:44,570
to output the value of this age variable to the cops.

83
00:04:44,600 --> 00:04:45,120
OK.

84
00:04:45,290 --> 00:04:47,610
As you can see here which is 25.

85
00:04:47,630 --> 00:04:48,260
OK.

86
00:04:48,470 --> 00:04:54,810
As you can see I assigned another value to my is the variable here.

87
00:04:54,980 --> 00:04:55,420
OK.

88
00:04:55,460 --> 00:05:03,140
So the value of this variable here is and comparison expression and this expression produces a result

89
00:05:03,230 --> 00:05:08,120
of either true or false depending on the value of the integer h.

90
00:05:08,140 --> 00:05:13,730
OK because age is 25 OK and age is less than 50.

91
00:05:13,730 --> 00:05:14,280
OK.

92
00:05:14,450 --> 00:05:21,440
And this expression evaluates to true and that true value is assigned to this isn't valuable.

93
00:05:21,560 --> 00:05:28,850
So if I run on my project as you can see this is the value of this is the variable that is out to the

94
00:05:28,850 --> 00:05:29,810
console OK.

95
00:05:29,840 --> 00:05:32,540
So that they actually show you some other examples.

96
00:05:32,870 --> 00:05:35,620
So let me comment out these lines of code here.

97
00:05:35,630 --> 00:05:38,370
So now let me actually create some other variables here.

98
00:05:38,420 --> 00:05:46,390
For example the Data Type of my variable is Boullion and the name of my variable is is powerful.

99
00:05:46,730 --> 00:05:49,730
And then I assign a value to my variable here.

100
00:05:49,820 --> 00:05:50,980
For example fart's.

101
00:05:51,000 --> 00:05:51,590
OK.

102
00:05:51,800 --> 00:05:55,600
And then at the end of my statement I need to put in a semi-colon OK.

103
00:05:55,790 --> 00:06:02,500
So if I output the value of this variable to the console system that out that line and then inside the

104
00:06:02,670 --> 00:06:08,940
prentices refer to the name of my valuable so here I want to put some text here.

105
00:06:09,120 --> 00:06:17,750
This is the value of the is powerful valuable.

106
00:06:17,820 --> 00:06:18,660
OK.

107
00:06:19,020 --> 00:06:22,710
And then at the end of my statement I need to put in a semicolon OK.

108
00:06:23,070 --> 00:06:29,230
So if I run my project now as you can see it's going to actually output this value to the consumer.

109
00:06:29,370 --> 00:06:35,850
So I forgot to actually put the variable name inside it practices so I use that plus operator here in

110
00:06:35,850 --> 00:06:39,190
order to concatenate this text with my variable name.

111
00:06:39,380 --> 00:06:39,980
OK.

112
00:06:40,070 --> 00:06:41,490
Is powerful.

113
00:06:41,640 --> 00:06:42,180
OK.

114
00:06:42,360 --> 00:06:47,920
And here I actually create a space here in order to make this readable.

115
00:06:48,360 --> 00:06:53,490
So if I run my project as you can see it outputs this value to the console.

116
00:06:53,490 --> 00:06:57,250
This is the value of that is powerful variable fots.

117
00:06:57,380 --> 00:06:58,030
OK.

118
00:06:58,200 --> 00:07:03,320
So I assigned the false value to my is powerful value.

119
00:07:03,330 --> 00:07:06,320
OK so now you want to create another variable.

120
00:07:06,480 --> 00:07:12,310
So for example the data type of my variable is it and the name of my variable is energy

121
00:07:15,180 --> 00:07:15,780
OK.

122
00:07:16,050 --> 00:07:18,150
And then I assign a value to my variable.

123
00:07:18,150 --> 00:07:24,110
For example 57 and then at the end of my statement I need to put in a semicolon.

124
00:07:24,420 --> 00:07:30,750
So here I want to output the value of this variable to the console system that out of that peninsula.

125
00:07:31,920 --> 00:07:37,530
And then inside Apprentice's I just need to refer to the name of my variable and at the end of my statement

126
00:07:37,590 --> 00:07:39,560
I need to put an assembly code on OK.

127
00:07:39,870 --> 00:07:44,520
So if I run my project as you can see it's going to output this value to the console.

128
00:07:44,520 --> 00:07:52,620
OK so let me actually put the text here just put into double quotes and inside the double quotes just

129
00:07:52,770 --> 00:07:53,700
type in your text.

130
00:07:53,700 --> 00:08:01,770
For example this is the value of the energy variable

131
00:08:06,900 --> 00:08:07,520
OK.

132
00:08:07,940 --> 00:08:12,410
And create a space here in order to make this value more readable.

133
00:08:12,460 --> 00:08:18,160
OK so if I run my project now as you can see it's now showing an error.

134
00:08:18,170 --> 00:08:19,520
OK.

135
00:08:19,520 --> 00:08:26,420
So as you can see here I forgot to actually put the plus operator in between these two values.

136
00:08:26,450 --> 00:08:26,980
OK.

137
00:08:27,050 --> 00:08:33,680
If you don't put this A-plus OPERATOR You cannot concatenate text and variables together.

138
00:08:33,680 --> 00:08:34,430
OK.

139
00:08:34,670 --> 00:08:40,850
So if you are on my project now as you can see it outputs this value to the console.

140
00:08:40,890 --> 00:08:43,860
OK this is the value of the energy value of it.

141
00:08:43,880 --> 00:08:44,390
OK.

142
00:08:44,450 --> 00:08:45,970
Which is 57.

143
00:08:46,100 --> 00:08:46,680
OK.

144
00:08:47,120 --> 00:08:50,650
So now I want to actually make a comparison here.

145
00:08:50,720 --> 00:08:53,340
So I need to refer to the name of the boolean value.

146
00:08:53,360 --> 00:08:55,750
Here is powerful.

147
00:08:55,900 --> 00:08:56,300
OK.

148
00:08:56,330 --> 00:08:58,960
And then I assign a value to my variable.

149
00:08:59,030 --> 00:09:01,890
And so I want to actually create an expression here.

150
00:09:02,030 --> 00:09:06,360
So energy greater than 80.

151
00:09:06,790 --> 00:09:07,270
OK.

152
00:09:07,340 --> 00:09:10,790
And then at the end of my statement I need to put in a semicolon.

153
00:09:11,060 --> 00:09:13,630
So as you can see here it's now showing me an error here.

154
00:09:13,640 --> 00:09:17,990
Let's actually how there are mouse pointer over the error area.

155
00:09:17,990 --> 00:09:23,240
So let's actually hover our mouse pointer over the error area and see what's this error.

156
00:09:23,240 --> 00:09:28,040
So as you can see I didn't write my variable name correctly.

157
00:09:28,040 --> 00:09:28,680
OK.

158
00:09:28,950 --> 00:09:33,380
And I need to actually put the letter E here.

159
00:09:33,590 --> 00:09:35,180
So now the error is gone.

160
00:09:35,300 --> 00:09:38,330
OK so now I want to output the value of.

161
00:09:38,330 --> 00:09:41,410
This is powerful variable to the console.

162
00:09:41,540 --> 00:09:49,130
So I just need to type in here system that out that printed on and then inside the prentices I just

163
00:09:49,130 --> 00:09:52,770
need to refer to the name of my variable is powerful.

164
00:09:52,880 --> 00:09:56,050
And then at the end of my statement I need to put in a semi-colon.

165
00:09:56,060 --> 00:09:56,380
OK.

