Before we start, did you try solving the workbook yourself?
If not, please click the link in the resources folder and follow the instructions for this workbook.
This video will go through the solution.
Four Workbook 1.1.
Here you'll see we have comments.
A comment is just a bunch of text that comes after two front slashes.
You can write whatever you want and comments.
It makes no difference to your code.
All right.
We're just going to use the comments as a guide.
So task one tells me to make a class.
You'll remember that by default, when you auto generate a class, it starts with the public keyword.
For the sake of consistency, we're going to do the same thing.
You will understand level of access in module to object oriented programming.
But for now, let's just follow through.
Then we'll say public class.
The class name has to always be the same as your file name.
So first program and inside brackets is where we can write all of our code.
Test two is inside the class.
Write the main method.
So if I just say main press the first option, it will autocomplete and you'll remember that this is
where your code starts running.
Main is the entry point, and here we have to print four messages.
So we'll say system dot out, dot print line.
And now I'll copy and paste this three more times.
The message is that I need to print.
Ah, right over here.
Printing is fun.
Java is better than Python.
And my dog ate to my java.
All right.
Finally, I'm going to run my code using terminal commands.
It seems I have another terminal open, so I will close it and stay on this one.
First I will compile the code inside a first program Java.
So Java compiler first program Java.
Then I will run the compiled code using the Java Command.
Java First program.
All right.
Success.
If you want to visualize the runtime, mean is the entry point of your Java application.
This is where Java starts running your code.
The first line of code in main print printing is fun.
The second one prints Java is better than Python and now Java looks for more code inside main.
But there isn't any, so it reaches the end and your runtime terminates.