1
00:00:00,300 --> 00:00:05,100
So here inside the main method I need to refer to the name of my method here.

2
00:00:05,100 --> 00:00:05,590
OK.

3
00:00:05,640 --> 00:00:06,830
Multiply two numbers.

4
00:00:06,870 --> 00:00:13,340
And now if I run on my project as you can see this is the result of multiplication of these two numbers.

5
00:00:13,360 --> 00:00:13,830
OK.

6
00:00:13,920 --> 00:00:18,210
So first then the project runs it can actually execute this main method.

7
00:00:18,210 --> 00:00:18,900
OK.

8
00:00:18,900 --> 00:00:24,350
And then inside the main method I am calling this multiply two numbers Smurfit.

9
00:00:24,480 --> 00:00:30,330
So it's going to actually go inside these multiply two numbers Smurfit and then it's going to execute

10
00:00:30,630 --> 00:00:31,860
these statements here.

11
00:00:31,860 --> 00:00:32,300
OK.

12
00:00:32,370 --> 00:00:36,580
So that's the result of execution of this line of code here.

13
00:00:36,680 --> 00:00:40,360
OK to multiply it by six is 12.

14
00:00:40,410 --> 00:00:42,720
So now let me show you another example.

15
00:00:42,930 --> 00:00:49,110
So first let me actually comment out this line of code here because I don't want to execute it.

16
00:00:49,170 --> 00:00:52,080
So here I want to create another method.

17
00:00:52,170 --> 00:00:57,850
So first I need to put this strategy for static.

18
00:00:58,050 --> 00:01:01,860
And this time my Millford is going to return an integer value.

19
00:01:01,870 --> 00:01:11,340
OK so the return type of mime if it is end and the name of my method is add two numbers together add

20
00:01:12,060 --> 00:01:16,200
two numbers together.

21
00:01:16,960 --> 00:01:17,730
OK.

22
00:01:18,180 --> 00:01:22,800
And then I need to put in a pair of round brackets at the end of my method name.

23
00:01:23,010 --> 00:01:28,350
And then I need to open and close my Mivart by using an opening curly brace followed by our closing

24
00:01:28,350 --> 00:01:29,340
curly brace.

25
00:01:29,370 --> 00:01:32,730
So as you can see here it's now showing us an error.

26
00:01:32,730 --> 00:01:36,780
So let's hover over the error area and see what's this error.

27
00:01:36,930 --> 00:01:40,640
This method must return a result of type int.

28
00:01:40,650 --> 00:01:43,760
So as you can see here we need to return a value of type.

29
00:01:43,800 --> 00:01:44,330
OK.

30
00:01:44,340 --> 00:01:47,800
Because the return type of this method is it.

31
00:01:47,820 --> 00:01:50,660
So here I want to create some variables.

32
00:01:50,760 --> 00:01:57,660
So the first variable is in A and then I assign a value to this variable.

33
00:01:57,660 --> 00:02:06,020
For example number 10 in the number 4 and then end result

34
00:02:08,650 --> 00:02:10,590
A plus B.

35
00:02:10,830 --> 00:02:13,720
Ok I can return this result from this month.

36
00:02:13,780 --> 00:02:14,290
OK.

37
00:02:14,380 --> 00:02:16,260
Return results.

38
00:02:17,150 --> 00:02:17,890
K.

39
00:02:18,310 --> 00:02:25,570
So as you can see here inside this method first I created this variable and then I created this variable

40
00:02:25,690 --> 00:02:33,220
and in line 55 I decided to actually add the value of these two variables together and that is going

41
00:02:33,220 --> 00:02:42,170
to assign the result of this operation with this result variable and in inline 36 and in line 46 I returned

42
00:02:42,170 --> 00:02:45,170
the value of that result variable from this method.

43
00:02:45,190 --> 00:02:45,870
OK.

44
00:02:46,240 --> 00:02:50,760
So as you can see here the data type of this result variable is in.

45
00:02:50,980 --> 00:02:53,910
And the return type of this method is int.

46
00:02:53,950 --> 00:02:57,650
OK so I can return this result variable.

47
00:02:57,670 --> 00:02:58,140
OK.

48
00:02:58,270 --> 00:03:00,910
So now I want to call this method from the same effect.

49
00:03:00,970 --> 00:03:08,320
So because this method returns a value of type anes we can actually directly output the return value

50
00:03:08,320 --> 00:03:10,050
of the sniffer to the console OK.

51
00:03:10,120 --> 00:03:17,980
So I can't just type in here or system that out that princeling and that inside the prentices I can't

52
00:03:17,980 --> 00:03:26,740
just refer to the name of my Meffert I can just refer to the name of my Meffert add two numbers together

53
00:03:26,950 --> 00:03:29,920
and then I need to put a semi-colon at the end of my statement.

54
00:03:29,920 --> 00:03:36,590
So now if I it on my project as you can see this value is now output to the console OK.

55
00:03:36,590 --> 00:03:40,930
So first when the program runs it's going to first execute this main method.

56
00:03:40,940 --> 00:03:41,530
OK.

57
00:03:41,750 --> 00:03:48,560
And inside that main fed you are actually trying to out food the return value of the Smurfette to the

58
00:03:48,560 --> 00:03:49,130
console.

59
00:03:49,130 --> 00:03:51,710
So then it's going to actually go inside this method.

60
00:03:51,710 --> 00:03:56,030
Add two numbers together and then it's going to execute these lines of code here.

61
00:03:56,030 --> 00:03:56,650
OK.

62
00:03:56,900 --> 00:04:01,970
And then it's going to output the return value of this Mefford to the console.

63
00:04:01,970 --> 00:04:05,230
So as you can see here this is the return value of this method.

64
00:04:05,240 --> 00:04:05,780
OK.

65
00:04:05,870 --> 00:04:09,820
Because this Smurfette returns a value of type integer.

66
00:04:09,830 --> 00:04:13,600
We can actually assign this Smurfette to another variable.

67
00:04:13,600 --> 00:04:15,580
With the end data type.

68
00:04:15,590 --> 00:04:16,290
OK.

69
00:04:16,580 --> 00:04:22,420
So for example I can create another variable int for example result.

70
00:04:22,960 --> 00:04:23,880
OK.

71
00:04:24,020 --> 00:04:26,370
And then I put an assignment operator.

72
00:04:26,570 --> 00:04:28,570
And then I referred to the name of my method.

73
00:04:28,610 --> 00:04:34,520
Add two numbers together and then I put a semicolon at the end of my statement.

74
00:04:34,520 --> 00:04:42,560
So now if I want to output the results to the console system that out that print land inside the practices

75
00:04:42,620 --> 00:04:49,390
I can refer to the name of my bad result and then I need to put in a semi-colon at the end of my statement.

76
00:04:49,400 --> 00:04:50,050
OK.

77
00:04:50,240 --> 00:04:55,090
So now if I run on my project as you can see it's going out with these two values for the console OK.

78
00:04:55,100 --> 00:05:00,610
So first when the program runs it's going to actually executed this main method and then it's going

79
00:05:00,610 --> 00:05:02,400
to execute this line of code.

80
00:05:02,580 --> 00:05:03,180
OK.

81
00:05:03,350 --> 00:05:06,940
So this is the value that is output to the console.

82
00:05:07,190 --> 00:05:07,890
OK.

83
00:05:08,170 --> 00:05:11,870
And and then it's going to actually execute these two lines of code here.

84
00:05:11,870 --> 00:05:12,470
OK.

85
00:05:14,150 --> 00:05:22,430
So as you can see here because this MF'er returns a value of type integer we can actually directly output

86
00:05:22,460 --> 00:05:23,870
that value to the console.

87
00:05:24,320 --> 00:05:28,820
As you can see here in line 13 you are actually outputting that value to the console.

88
00:05:28,820 --> 00:05:30,020
So this is the result.

89
00:05:30,200 --> 00:05:35,320
Or we can actually assign that value to another variable with the insulator type.

90
00:05:35,420 --> 00:05:39,430
And then we can actually output the value of that variable to the cops.

91
00:05:39,430 --> 00:05:40,240
OK.

92
00:05:40,550 --> 00:05:41,810
So this is that.

93
00:05:41,880 --> 00:05:44,010
OK for the number 14.

94
00:05:44,390 --> 00:05:50,060
So if I for example comment out this line of code here and if I run on my project again this is that

95
00:05:50,070 --> 00:05:51,340
value OK.

96
00:05:51,830 --> 00:05:53,810
So now let me show you another example.

97
00:05:53,960 --> 00:05:57,970
So first let me comment out these two lines of code here.

98
00:05:59,320 --> 00:06:01,710
Now I want to create another my fifth.

99
00:06:01,840 --> 00:06:03,910
So I just need to type in here static

100
00:06:06,550 --> 00:06:20,340
void OK the return type of My method is void and the name of my method is subtract two numbers OK.

101
00:06:20,380 --> 00:06:26,050
And then I need to put in a pair of round brackets at the end of my Meffert name and this time I want

102
00:06:26,050 --> 00:06:29,570
to specify that my method is going to have arguments.

103
00:06:29,620 --> 00:06:37,930
OK so the first argument is it and the name of my argument is name one.

104
00:06:38,590 --> 00:06:46,660
And the second argument again is in the name of my argument is not two and that I need to open and close

105
00:06:46,660 --> 00:06:51,920
my method by using an opening curly brace followed by our closing curly brace.

106
00:06:51,970 --> 00:06:56,230
So as you can see here inside the Meffert I can put in my statements.

107
00:06:56,230 --> 00:07:02,240
So now I want to create a variable in the name of my value.

108
00:07:02,260 --> 00:07:08,870
But as a result I want to actually subtract the first argument from the second argument.

109
00:07:08,890 --> 00:07:13,090
Now one minus not two.

110
00:07:13,150 --> 00:07:13,840
OK.

111
00:07:14,170 --> 00:07:17,690
And then I need to put in a semicolon at the end of my statement.

112
00:07:17,740 --> 00:07:21,210
So now I want to output the result to the console.

113
00:07:21,370 --> 00:07:28,510
So I just need to type in here system that out that the print line and inside the prentices I just need

114
00:07:28,510 --> 00:07:37,150
to refer to the name of my variable result and then I need to put in a semi-colon at the end of my statement.

115
00:07:37,180 --> 00:07:44,160
So here inside the main method or you want to call my method subtract two numbers.

116
00:07:44,210 --> 00:07:46,140
Nonviolent is 20.

117
00:07:46,360 --> 00:07:48,100
And number two is five.

118
00:07:48,250 --> 00:07:48,940
OK.

119
00:07:49,180 --> 00:07:54,980
And if you run my project now as you can see this is the value that is output to the console OK.

120
00:07:55,090 --> 00:08:00,970
So first when the program runs it can actually execute this main method and then it's going to execute

121
00:08:01,030 --> 00:08:02,160
this line of code here.

122
00:08:02,170 --> 00:08:03,780
Subtract two numbers.

123
00:08:04,030 --> 00:08:08,500
So the Smurfette accepts two values the first value is 20.

124
00:08:08,620 --> 00:08:10,190
And the second value is five.

125
00:08:10,270 --> 00:08:13,850
And then it's going to actually go inside the Smurfette.

126
00:08:13,900 --> 00:08:19,480
So as you can see here this is our friend and that it can actually execute the statements inside this

127
00:08:19,480 --> 00:08:19,830
method.

128
00:08:19,840 --> 00:08:20,290
So.

129
00:08:20,320 --> 00:08:26,860
So as you can see here in line 49 you are actually subtracting the value of the non-valid variable from

130
00:08:26,860 --> 00:08:28,450
the value of the not too valuable.

131
00:08:28,450 --> 00:08:29,210
OK.

132
00:08:29,620 --> 00:08:36,400
And we are actually assigning the result of this operation to the result variable and in line 50.

133
00:08:36,400 --> 00:08:41,300
We are actually outputting the value of the result variable to the console.

134
00:08:41,620 --> 00:08:43,420
So as you can see here this is that value.

135
00:08:43,420 --> 00:08:43,810
OK.

136
00:08:43,810 --> 00:08:46,140
So now I want to show you another example.

137
00:08:46,270 --> 00:08:50,560
So let me comment out this line of code here because I don't want to execute it.

138
00:08:50,620 --> 00:08:52,780
Now I want to create another method.

139
00:08:52,930 --> 00:08:54,930
So I just need to type in here static.

140
00:08:55,270 --> 00:09:00,160
And this time if it is going to actually return a float value.

141
00:09:00,460 --> 00:09:10,050
So the return type of my Meffert is float and the name of my method is divided 2 numbers.

142
00:09:12,550 --> 00:09:13,300
OK.

143
00:09:13,590 --> 00:09:19,620
And then I need to put in a pair of round brackets at the end of my Meffert name and inside the round

144
00:09:19,620 --> 00:09:20,500
brackets.

145
00:09:20,590 --> 00:09:24,270
I want to actually specify that my if it is going to have arguments.

146
00:09:24,290 --> 00:09:35,420
Ok so my first argument is float and the name of my argument is one and my second argument is again

147
00:09:35,470 --> 00:09:39,410
float and the name of my argument is number two.

148
00:09:39,680 --> 00:09:46,600
And then I need to open and close my Meffert by using edge and opening curly brace followed by our closing

149
00:09:46,610 --> 00:09:47,450
calibrates AK.

