00:01
Welcome to this lesson.
00:02
In this lesson we will answer the following questions.
00:07
So here we are looking at 4 .2.
00:10
What is the line of code labeled a do? so labeled a.
00:16
So this is the main method.
00:18
It creates the main method where we can print from.
00:22
So i will say create the main method as a point of entry.
00:46
So that's the point of entry of the program.
00:48
That's the point of entry.
00:52
Alright.
00:54
Now let's go to the 2.
00:57
Question 2.
01:13
So what happens on line b? we are looking at what happens on line b.
01:19
We create a string.
01:21
We create two string variables.
01:25
Last name and last.
01:29
Press and last.
01:30
Okay.
01:32
So here create two string variables.
01:44
String variables.
01:47
Go to empty string variables.
01:50
String variables.
01:59
So we have last and first.
02:08
Alright.
02:08
So that is what happens.
02:10
Now if the hole from this side is the scanner is also part then we also create the scanner object called input.
02:23
We also create the scanner object.
02:25
The scanner object is basically used to get user input from the command line.
02:30
Alright.
02:32
So the third one we are looking at what happens at c.
02:38
So what is happening on line c? we get user input from the command line.
02:50
Install to the first.
02:53
The variable first.
02:55
So we get user input from the command line.
03:08
Install to variable first.
03:15
Okay.
03:17
So now the input that we get is a string and we install to first.
03:24
Alright.
03:25
The next one what does a line d do? let's look at what it does.
03:31
Line d.
03:34
This is line d.
03:35
So it invokes the method display salutation and pass in the parameter first.
03:43
So displays.
03:48
So it invokes the method.
03:57
The method gets salutation.
04:08
The method displays salutation.
04:18
And pass in the parameter first.
04:33
And pass in the string parameter.
04:37
So it passes in the string parameter first.
04:44
Alright.
04:45
So here the display salutation.
04:50
And this is the method that it calls.
04:54
Okay.
04:55
So it invokes the method display salutation.
05:03
Now let me even put in which of the methods it invokes.
05:10
Alright.
05:10
So this method.
05:11
This is what it invokes.
05:13
It has two signatures.
05:15
So it calls the one with a string.
05:20
Alright.
05:20
This one string.
05:24
Okay.
05:27
Now let's go to the next one.
05:30
The next one we are looking at.
05:32
It invokes the first and last call in programming.
05:36
So in line e.
05:40
Let's look at line e.
05:43
So line e the first and second they are all method parameters.
05:49
So they are all parameters or arguments.
06:02
So they are called method parameters or arguments.
06:12
Now let's go to the next one.
06:16
So the next one we are looking at.
06:22
Which of the lines closes the method.
06:25
Is it line f or i? line f.
06:32
Let's look at line f.
06:34
Okay.
06:44
This is the main method.
06:45
So the one that closes the main method is line f.
06:49
Alright.
06:50
So line f closes the main method.
06:54
So line f closes the main method.
07:03
Now let's look at what does line g.
07:08
Why does line g have void.
07:11
So why would a method be declared as a void...