Overview Of Programming With Java > Simple Programs and Development environment >
Siva Nookala - 03 Mar 2017
Siva Nookala - 03 Mar 2017
Simple Java Program :
Lets look at the simplest Java program which prints Hello World onto the output screen. Every Java program needs this structure and with out this the program can not be successfully executed.
Hello World Program CODE class PrintHelloWorld OUTPUT Hello World DESCRIPTION Every Java program contains the following structure. class class-name { public static void main(String args[]) { program-content } } In this example, we have called class-name as PrintHelloWorld and in program-content, we have included the code System.out.println("Hello World"); , which will print Hello World to the screen.
The words used like 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.THINGS TO TRY
Dependent Topics : JDK JRE JVM JIT - Java Compiler |