1
00:00:00,510 --> 00:00:02,160
Double that part stubble.

2
00:00:02,280 --> 00:00:08,490
So as you can see we have a class called Double And this is actually a static effect of this of this

3
00:00:08,490 --> 00:00:09,460
class stubble.

4
00:00:09,960 --> 00:00:15,660
And we are actually calling this Meffert and this class and here we are actually putting this string

5
00:00:15,660 --> 00:00:18,430
value as a parameter to these Meffert.

6
00:00:18,450 --> 00:00:18,920
OK.

7
00:00:18,960 --> 00:00:22,020
Double parse double and the string value.

8
00:00:22,020 --> 00:00:25,700
Here we are actually converting this string value to a double value.

9
00:00:25,980 --> 00:00:26,490
OK.

10
00:00:26,580 --> 00:00:34,470
Again let's actually create another double variable number two assignment operator double that part

11
00:00:34,490 --> 00:00:42,790
stubble EDT Nahm to dot text dot to a string.

12
00:00:44,090 --> 00:00:44,880
OK.

13
00:00:45,380 --> 00:00:55,180
Again another double variable double Nahm three assignment operator double that part's double EDT.

14
00:00:55,410 --> 00:00:56,880
Now I'm free.

15
00:00:57,160 --> 00:00:57,940
That's good.

16
00:00:57,950 --> 00:01:01,130
Text that too strict.

17
00:01:01,520 --> 00:01:02,170
OK.

18
00:01:02,420 --> 00:01:04,020
So hopefully that makes sense.

19
00:01:04,100 --> 00:01:10,730
Here I am actually reading the values of these textfield and I am actually converting that values to

20
00:01:10,730 --> 00:01:16,320
add double value and I am assigning that those double values to these are double value.

21
00:01:16,430 --> 00:01:17,130
OK.

22
00:01:17,540 --> 00:01:24,530
So let's actually create another double variable and the name of this variable is result.

23
00:01:25,290 --> 00:01:35,620
Assignment operator and now I want to actually get the maximum number of these free double values.

24
00:01:35,630 --> 00:01:36,060
OK.

25
00:01:36,110 --> 00:01:39,550
So let's actually create Smurfit here.

26
00:01:39,980 --> 00:01:47,610
Outside of these uncreate method and inside of these main activity class let's actually create a method.

27
00:01:47,690 --> 00:01:48,590
Ok everyone.

28
00:01:48,590 --> 00:01:52,000
Now let's actually create a method here public.

29
00:01:52,940 --> 00:01:57,320
And as you can see that the access modifier of this method is public.

30
00:01:57,530 --> 00:02:05,090
And now I want to actually specify a return type before my method double and the name of my method is

31
00:02:05,090 --> 00:02:07,510
get the maximum.

32
00:02:08,780 --> 00:02:14,740
And then in say the prentices I want to actually specify that this method is going to accept some arguments.

33
00:02:14,760 --> 00:02:15,260
OK.

34
00:02:15,350 --> 00:02:23,740
Double and the name of my first argument is number one comma double.

35
00:02:24,270 --> 00:02:26,880
Number two comma.

36
00:02:27,080 --> 00:02:29,090
Double free.

37
00:02:29,350 --> 00:02:30,040
OK.

38
00:02:30,440 --> 00:02:35,410
And then I need to actually open and close my method by using these curly braces.

39
00:02:35,780 --> 00:02:40,370
And here I want to actually get the maximum of these free double values.

40
00:02:40,370 --> 00:02:40,890
OK.

41
00:02:41,120 --> 00:02:49,680
So first let's actually create a WRGA double and the name of my variable is the maximum value.

42
00:02:49,760 --> 00:02:56,720
And then I put an assignment operator here and then I can actually assign one of these arguments to

43
00:02:56,720 --> 00:02:57,830
my valuable.

44
00:02:57,830 --> 00:03:04,750
So I prefer to assign numbers but not one argument to my variable number one semicolon.

45
00:03:04,760 --> 00:03:11,780
Here I am actually assuming that the value of this number one value number one argument is the maximum

46
00:03:11,780 --> 00:03:12,290
value.

47
00:03:12,290 --> 00:03:13,000
OK.

48
00:03:13,460 --> 00:03:23,230
So let's actually create an if statement here if Number two is greater than the maximum value.

49
00:03:23,810 --> 00:03:24,290
OK.

50
00:03:24,410 --> 00:03:29,940
The maximum value assignment operator 2 OK.

51
00:03:30,440 --> 00:03:37,970
Here I am actually specifying that if the value of this Nahm two argument is greater than the value

52
00:03:37,970 --> 00:03:46,000
of this the maximum value then assign the value of this number two variables to the maximum value value.

53
00:03:46,090 --> 00:03:46,600
OK.

54
00:03:46,670 --> 00:03:52,760
And here I am actually saying that if the value of this number two argument is greater than the value

55
00:03:52,760 --> 00:04:00,530
of this the maximum value then assign the value of this Nahm to argument to this at the maximum maximum

56
00:04:00,530 --> 00:04:01,450
value of value.

57
00:04:01,470 --> 00:04:02,070
OK.

58
00:04:02,480 --> 00:04:05,030
That's actually create another IIF statement here.

59
00:04:05,120 --> 00:04:16,400
If the value of this free variable is greater than the value of this the maximum value then assign the

60
00:04:16,400 --> 00:04:19,790
value of the is now free variable to this.

61
00:04:19,870 --> 00:04:21,410
The maximum value variable.

62
00:04:21,410 --> 00:04:23,120
Ok now I'm free.

63
00:04:23,900 --> 00:04:24,650
OK.

64
00:04:24,890 --> 00:04:30,830
So here I need to actually return a value of type double from the Smurfette.

65
00:04:30,830 --> 00:04:35,590
So I can't just type in return the maximum value.

66
00:04:35,600 --> 00:04:37,130
OK.

67
00:04:37,130 --> 00:04:39,180
So hopefully that makes sense.

68
00:04:39,770 --> 00:04:41,450
And let me actually explain again.

69
00:04:41,450 --> 00:04:47,660
First of all we assumed that the value of this number one variable is the maximum value and that we

70
00:04:47,660 --> 00:04:50,460
created two statements here.

71
00:04:50,870 --> 00:04:57,530
And first of all we said that if the value of this not too valuable is greater than the value of these

72
00:04:57,620 --> 00:05:04,170
are the maximum value variable then assign the value of this not to argument to this the maximum value

73
00:05:04,190 --> 00:05:11,400
variable and if the value of this non-free variable this argument is greater than the value of this

74
00:05:11,400 --> 00:05:18,470
stomach the maximum value variable then assign the value of this no free variable to the maximum value

75
00:05:18,470 --> 00:05:19,000
variable.

76
00:05:19,000 --> 00:05:19,580
Okay.

77
00:05:19,580 --> 00:05:23,930
And then with the deterrent value of this the maximum value value of it.

78
00:05:24,040 --> 00:05:25,190
Okay.

79
00:05:25,880 --> 00:05:27,910
So hopefully that makes sense.

80
00:05:28,100 --> 00:05:31,540
And let's actually go back inside this uncle explain it.

81
00:05:31,730 --> 00:05:40,190
And here I can just typing get the maximum and now I need to make sure the passing free double values.

82
00:05:40,280 --> 00:05:52,910
So I want to actually refer to these is Nahm number one comma not too comma free and that I need to

83
00:05:52,910 --> 00:06:00,470
actually put a semi-colon at the end of my statement and then I want to actually output these values

84
00:06:00,470 --> 00:06:02,800
to the screen so I can just type in.

85
00:06:02,810 --> 00:06:11,050
So here I can just type anti-X the result that said text and then I can just refer to the name of this

86
00:06:11,090 --> 00:06:14,390
result variable result.

87
00:06:14,570 --> 00:06:22,100
And because this variable is actually of type double we cannot assign that value directly into this

88
00:06:22,160 --> 00:06:24,080
RTX the result object.

89
00:06:24,080 --> 00:06:27,770
So we need to actually convert this value to our string value.

90
00:06:27,770 --> 00:06:32,200
So I can just put in our Plus operator here.

91
00:06:32,300 --> 00:06:34,510
And then I can just put it into double quotes here.

92
00:06:34,520 --> 00:06:35,150
OK.

93
00:06:35,150 --> 00:06:39,200
So as you can see now this value is actually converted to a string value.

94
00:06:39,340 --> 00:06:39,930
OK.

95
00:06:39,980 --> 00:06:43,090
Now let's actually run our project and see the results.

96
00:06:43,190 --> 00:06:44,110
Ok everyone.

97
00:06:44,150 --> 00:06:48,560
Now as you can see our application is actually running on this emulator.

98
00:06:48,710 --> 00:06:53,410
So here for the first textfield I can just put in a value.

99
00:06:53,660 --> 00:06:55,630
So just click on this textfield.

100
00:06:55,760 --> 00:07:00,510
And now as you can see the virtual keyboard is actually appearing here.

101
00:07:00,710 --> 00:07:07,130
So just click on these numbers and I can just assign a number here for example number for 50 and for

102
00:07:07,130 --> 00:07:15,290
the second textfield I can assign another value for example number 70 and for the first textfield I

103
00:07:15,290 --> 00:07:16,550
can assign an added value.

104
00:07:16,550 --> 00:07:18,410
For example number 100.

105
00:07:18,670 --> 00:07:19,300
OK.

106
00:07:19,550 --> 00:07:26,960
And if you want to disappear this keyboard you can just click on this little triangle here and then

107
00:07:27,140 --> 00:07:29,960
you can just click and this get the maximum value.

108
00:07:29,990 --> 00:07:37,240
So as you can see them the maximum value of these free text fields is numbered 100.

109
00:07:37,250 --> 00:07:38,030
OK.

110
00:07:38,030 --> 00:07:44,840
So let's actually change the value of this textfield here so I can just delete this number and I can

111
00:07:44,840 --> 00:07:49,040
assign another value for example number 400.

112
00:07:49,700 --> 00:07:56,870
And there's actually I click on this get the maximum value here as you can see now the maximum value

113
00:07:56,870 --> 00:07:58,160
is 400.

114
00:07:58,220 --> 00:08:02,910
And this data point zero here means that this value is actually a double value.

115
00:08:02,990 --> 00:08:03,910
OK.

116
00:08:04,490 --> 00:08:06,620
So hopefully that makes sense.

117
00:08:06,620 --> 00:08:08,830
Let's actually go back inside our coats.

118
00:08:08,990 --> 00:08:14,630
Main activity that will find here and after this are set on a quick listen in Meffert as you can see

119
00:08:14,630 --> 00:08:23,300
after the end of this method I can refer to the name of these PTEN secure random number that set unclick

120
00:08:23,360 --> 00:08:29,050
listener new view that Uncle is listening.

121
00:08:29,080 --> 00:08:29,980
OK.

122
00:08:30,550 --> 00:08:35,500
So as you can see here now we can actually put our own coats inside of this method.

123
00:08:35,500 --> 00:08:40,140
So now let's actually create an object from the secure random class.

124
00:08:40,270 --> 00:08:47,920
So Sahira and M-class is a class in Java so secure random class is actually a class a predefined class

125
00:08:47,920 --> 00:08:55,960
in Java that actually produces secure random numbers OK which we can actually use in your own games

126
00:08:56,020 --> 00:08:58,300
or your own applications.

127
00:08:58,300 --> 00:08:58,860
OK.

128
00:08:59,080 --> 00:09:05,680
And I highly recommend you that you actually use this class this class if you want to produce a secure

129
00:09:05,940 --> 00:09:09,390
our random numbers for your applications.

130
00:09:09,400 --> 00:09:12,590
So here I actually referred to the name of this class now.

131
00:09:12,640 --> 00:09:18,550
And as you can see here if I click on these free dots here as you can see now these are the classes

132
00:09:19,090 --> 00:09:21,220
that you actually imported into a file.

133
00:09:21,430 --> 00:09:23,230
And one of these are classes.

134
00:09:23,230 --> 00:09:29,670
If you have these secure random class that is inside the Java security package and this class is inside

135
00:09:29,680 --> 00:09:30,430
of this package.

136
00:09:30,430 --> 00:09:35,910
Ok secure random and we can actually use this class here.

137
00:09:35,980 --> 00:09:44,200
So secure random and the name of our object is secure random number OK.

138
00:09:44,230 --> 00:09:51,550
Assignment operator new and again I need to refer to the name of this secure random class.

139
00:09:51,970 --> 00:09:56,300
And now let's actually create an if statement here.

