Hello World

Hello World #


We will be printing out the sentence ‘Hello World’


public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
}

Parts #

  • public class HelloWorld {
    • We defined a public class named HelloWorld . We will get to classes later
  • public static void main(String[] args) {
    • We wrote out, public static void main(String[] args), which is a declaration in which we will later go into in detail
  • System.out.println("Hello World");
    • Is a common way to print out phrases. To print out phrases, they need to be in quotes
  • { }
    • The curly brackets, { }, are used to define what is in a function.
  • ;
    • After each line of code that is not declaring a class or a main, we usually put a semi-colon(;) after it