The document provides instructions on how to create a basic Java project in IntelliJ IDEA. It explains how to set up a new project, create a Java class, add a main method that prints 'Hello World' to the console, build the project, and run it to see the output.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
19 views2 pages
1 1 1 Helloworld-En
The document provides instructions on how to create a basic Java project in IntelliJ IDEA. It explains how to set up a new project, create a Java class, add a main method that prints 'Hello World' to the console, build the project, and run it to see the output.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2
>> In this video, we're going to show you how
to make your very first Java project.
When you first open your program IntelliJ, you might see a screen that looks like this. You're going to want to select, create a new project then you're going to come here and make sure that you've already set up your SDK so that it's pointing at Java. Don't click any of these libraries and do not click any project templates. Those are going to add bits of code that you just don't need. Now you come to the page where you are going to decide where your project's code is going to be stored. And it's very important to keep this orderly and organize, otherwise it can get a bit confusing. I suggest making brand new folders within your folder system specifically for all of your code projects. I'm going to come here and I'm going to create a new folder just for this code. Every time you create a new project, you should make a new folder and I'm going to call this project Hello/World. As you can see, it automatically populates my project name based on my file name. Now when I hit finish, it takes me to sort of an empty screen with an IntelliJ. I can't actually type any code here but I'm going to want to expand this folder, this is my project explorer view and right click on the src folder. Create a new Java class and this is where you're renting name your Java class, this is with the specific file where you're going to type your code. I'm also going to type name this, Hello/World, after the Java conventions for class naming, meaning it starts with a capital letter no spaces allowed. Once I hit okay, you can see that IntelliJ already gives me just a little bit of code to get started based on the name. That's because in Java you have to name this file the same thing as the class name so IntelliJ takes care of that for you. Now, I'm going to come in here and just by hitting enter you can notice that IntelliJ automatically indents my code. That's because I'm not going to write my main method inside of my class header. And always starts with the same keywords public, static, void, main, break, parentheses, string, bracket, bracket, args and then a set of curly braces. Those words don't have a lot of meaning now, so you'll probably just end up memorizing them until you understand what each of those words mean later on. Now my goal is just to print the words, Hello/World, to the console. And the way that I do that is with a system.out.printin and then in between the parentheses and in between the quotation marks, I'm going to write the text I want to appear on the console, Hello world. And then at the end in my line, you can see I have that red squiggly that means I forgot my semi-colon. Now my code is ready to go. First, I'm going to build my project. This tells the computer to go and turn all of this into actual code the computer can understand. Now that it's built, I'm going to run my code but you have to actually tell IntelliJ which file to run so I'm going to select, Hello/World. And there it is, Hello world. Once the program has finished running, it's going to pop up your console and print the words that you told it to just like we said.
Learn C# From Scratch in One Hour C# Book for Absolute Beginners with Hands On exercises and Real-World Examples the one book you need to quickly Master C# Programming,: No prior experience is required