1.4 Creating Your First Java Program Part 2
Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or
Already have an account? Sign In »

Video Transcription
00:00
Now that we have a new project created, you can go ahead and click on this folder here, which is essentially just our project folder with the name that we assigned it
00:12
inside of the product folder. We have another folder called SRC, or also known as source or source code.
00:20
Now, in this folder, we will have something that we will discuss later on their course called Java Classes.
00:28
Go ahead and right. Click on
00:31
this folder and
00:34
select Java class.
00:38
If you are on live, allow a lab guide. Then we are on step number five.
00:44
Now, here, in the name you can name your Java class, whatever you would like to name it. But I'm gonna go ahead and name it
00:52
Lab one.
00:55
Or let's name it. Hello, world,
00:59
And I'm gonna click. Okay,
01:02
off, Since already, I've already used hello world, and this is taken. So I'm gonna just stick to lab one that you can name it. Whatever you would like to name it, I'm gonna click. Okay,
01:12
now what that does is it creates something called a new class for us, which, as I mentioned previously, we will be discussing in the next module
01:23
for us and just create a simple program. Today we need two main things. One is a main method. If you
01:30
look at stepping number six, it says, add a mean method to your program.
01:36
No,
01:38
a mean method is just essentially an entry point to your program.
01:42
So let's follow what this step is telling us to do over here.
01:47
Please ignore this line in between. That says the system don't outdoor print light. For now. Just go ahead and type the public static void Maine
01:56
with whatever's in the parameters,
02:00
I'm gonna go ahead and type that public
02:02
static
02:07
would main
02:09
and then
02:14
string
02:17
okay and then sue
02:20
curly brackets.
02:22
Once we do that, let's move on to step number seven, it says. Add the following line to print a word or sentence to your program, Consul.
02:30
Now let's say we want to print out Hello World for this
02:35
specific example. We're going to be typing in this specific line, which tells the program that it wants to print something too.
02:45
The consul.
02:51
Now inside we're getting we're gonna be writing the word or sentence that we want to print.
02:58
So I'm gonna type hello world in this case.
03:00
Once you have done that,
03:02
go ahead and click on the source folder on our class name, Right, Click and run the program.
03:14
Now, once you run the program, it's gonna start building it. And as you can see here, our consul just popped up and we have our word printed out to the consul. Great.
03:24
That is your first program in Java printing something simple to the consul, which is a classic example that people use to get into Java and learn some of the very basic things.
03:42
Now, at this moment, you can go ahead and exit Java. Sorry, Exit intelli J. By clicking on the X, I come over here
03:53
going back to our
03:55
slides and video in this video, lecture or lab, we discussed what a. J. D. K. Is and creating our first Java program.
04:08
In the coming video, we are gonna be talking about data types and variables in Java and how we can use data types in variables.
04:18
Now, as always, if you have any questions or want to connect with me, you can go ahead and join my lengthen below. And I would be more than happy to answer any of your questions. And I look forward to seeing you in the next video. Thank you very much for
Up Next
Similar Content