Habenero Java

Java is an objectoriented language. This means that it relies on the use of Classes inside of Packages in order to execute its code. There will be more on using these later, but for now just understand that it works under a heirarchical structure; this means that small bits of code can be developed, and then combined with other pieces in order to make one large program.
Java was developed in order to excell in cross-platform functionality, meaning that nearly identical code can be made for an array of machines, and all of them will run it without any problems. This is great news for the programmers, as they can have machines do all of the work for sophisticated programs.

Now comes the time for us to make our first program. Welcome to the world of codding, because all you have to do to make your first program, is launch your IDE, and type a few simple statements into the editor:

public class ClassName{
    public static void main(String[] args){
    }
}

Now you might be wondering how this is a program, or you might even have tried to launch it, and noticed that it did not do anything. Well, before we get to making cutting-edge graphics or advanced artificial intelligence, we have to understand what the compiler sees here. Let's walk through this line-by-line.

In the first line, we declared "ClassName" to be of type "class", and to be public. "public", means that it can be accessed by other, outside classes. "class", is the type here; this refers back to the heirarchy, and we are letting the computer know that is code we want to use, for whatever program we put it inside of. Finally, "ClassName" is just the name of the class. You could have given it nearly any name you wanted, so long as it began with a letter or an underscore, and it contained some compination of letters, underscores, and numbers.

In the second line, we made what is called the main function. It may look complicated, but all that you need to know right now is that it is what the computer actually runs. When you tell the computer you have a new Java program, it will look for this line, and run whatever is between this and its closing bracket.

The symbols { and } are actually decently simple. Whatever is enclosed inside is considered to be part of the code block. In both cases of these symbols, they contribute further to the heirarchical organization of the program. In this way, we can make the main function a child of the class ClassName. Furthermore, as we continue on, we will add children to the main function.

As there is an opening brace for the main function, and a closing slightly later on, the computer will execute whatever is legitimate Java and is enclosed within. We can use this information to make our first program that actually shows signs of working in the next tutorial, where we will talk about displaying output to the console.

Click here to coninue to the next tutorial.