CODE
class PrintHelloWorld
{
public static void main(String args[])
{
System.out.println("Hello World");
}
}
Hello World
Every Java program contains the following structure.
PrintHelloWorld
and in program-content, we have included the code System.out.println("Hello World");
, which will print Hello World to the screen.
class
, public
, static
, void
, main
, String
, System.out.println
, the flower brackets {}
, the parentheses ()
and the square brackets []
, will be explained later. For now only remember the structure and understand that every program needs this structure.Hello World
" to "Hello Universe
" and see the result.System.out.println
) to print the text "I completed my first java program.
" and see the output.