Hello World

6 minutes
Share the link to this page
Copied
  Completed

Transcript

Hello there, and welcome back to the Java development course. So, today we're going to be going over the very first lesson here, all we're going to be doing is installing an integrated development environment for Java, as well as creating a Hello World program. If you don't know when you're learning a new programming language, essentially the by convention, the first program that you write is just something that outputs the text hello world to the screen. So let's get started with that now. For starters, we're going to need to install an integrated development environment, or an ID for short. And it isn't just an application with a text editor that allows us to work with code.

It gives us a set of very useful features. We'll see them in a second for starting school. Let's go ahead and download it. So we're going to be using Eclipse. Just search for it on Google and you have Eclipse downloads. Okay, click on Eclipse IDE for Java developers and click on download.

Okay, select the latest version, it should automatically give you it and download. There we go. Okay, give it a couple seconds to download. Okay, there we go. So now that it's downloaded, this is the final issue that you should now have. Let me go ahead and open it up.

And there we go. Now we have our Eclipse installer. Let's open that. Give it a couple seconds. And there we go. So here we have some options.

As to what Id we want to install. Make sure you select this Eclipse IDE for Java developers. Select a place where you will install it and click Install Okay, so after we have installed our Eclipse application, we can now see this Launch button. Let's go ahead and click it. And it should open up Eclipse. Again, give it a couple of seconds.

And there we go. So we can now select our workspace. So the workspace is actually the place where we're going to hold all our project files. project files are essentially just everything that we need for a project. This is going to be files of code, files, maybe if we have some images, it's going to be images and so on. So you can really choose any location for now let's just choose the default one that it gives us.

Let's go and click Launch. Okay, again, give it a second or so. Whenever you're installing an application for the first time, especially Eclipse should always take some time, you can go ahead and close this window. This is just you know, welcome screen where you can, you know, get an idea about the about Eclipse, if you're curious, go ahead and look through it. But for now, we'll just go ahead and remove it. Alright, and then close the cheat sheets application as well.

There we go. Alright, so now let's go ahead and make our application full screen. And let's create a new project. So I'm going to create a new Java project. Project one. There we go.

Now, leave everything here. As it is, there's really no point in changing it now go over it perhaps later in this course. Then let's go ahead and click Finish. And there we go. So we have on the left our project inside of our project, you should see a src folder. This is the place where we're going to put all our Java files.

So we can actually create a java file by saying, new, and then class. Okay, so again, don't pay attention to any of this. For now, all we need to understand is the name. This is going to be the name of a class. Let's just call it class one. There we go.

And now we're also going to create a public static void Main. So all this will do is just create a method inside our class, which will be called main. So the main method is actually where Java will start to run our application from. For now, just ignore this. It's really there's really no point in understanding it. We'll go over methods later on in this course.

Alright, so let's go and click Finish. And there we go. Now we have our class one. Let me go ahead and close up all of this on the side, just like don't take away space and make the text bigger. And there we go. So now we're ready to write our first line of code.

First of all, let's delete this. There we go. So now you can see this is our class, public Class, Class one, we have it. And then we also have our main method. Again, don't, don't pay attention to this, we'll go over both classes and methods later on in this course. For now, just understand that any code we write we're going to write in here.

So now let's output hello world. So we're going to do system dot out, dot print ln. And then in double quotation marks, hello, world. There we go. Okay, and let's put a semicolon after the line. And there we go.

Now let's run our application. Let's save it. And then you can go and click this run button up here. And let's run it. And there we go. We get a console with hello world.

Okay, so in this lesson, we have installed it. And we have created our very first Java application that prints hello world to the console. That's all already a pretty big achievement. Nevertheless, you'll find that with the Java, there is so much more that we can do and there's so much more to learn. But we've already taken the first step to becoming an expert Java developers. I'll see you next time till soon

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.