My First java program





//This is my first java program

public class simple
{
     public static void Void main( String[] args)
{
      system.out.println("hello java");
}
}//no semicolan when class ends in java

output: hello java



class can be defined as a template/blueprint that describes the behavior/state that the object of its type supports

public It is an keyword an access modifier which represents visibility it means it means it is visible to all.

static is a keyword ,if we declare any method(in java we call function as a method) static it is known as static method.The core advantage of static method is that there is no need to create object to invoke the static(method).The main method is executed by the JVM , so it doesn't require to create object to invoke the main method. So it also saves Memory.

 void it is a return type, it does not return any value.

main represents start up of the program.

String[] args is used for command line argument

system.out.println() is used to print statement





Here ln at last of print is used to cause line feed without ln we can only print the statement in linear.

Comments

Popular posts from this blog

week 14(11 -15 November)

week 17(2-6 December)

week 13( 4-8 November)