Friday 6 October 2017

Explanation of first program of Java

CREATING A SIMPLE JAVA PROGRAM

In this page we try to understand java program, and this helps us lot more in building further java programs.

Class Demo//syantax of creating class(try to discuss more in next classes

{

public static void main( String... args)//this is a new method to create an array and it comes in JDK 1.5.{

System.out.println("Hello friends, this is our first java program");

}

}



EXPALNATION:-
PUBLIC:- Public is an access specifier or access modifier and it tells the JVM that it is visible to all and JVM call this method from anywhere.


STATIC:- Static is a keyword which plays an important role in java main method IT                    tells JVM that their is no need to create object of main method to invoke main method beacuse it is executed by JVM directly so thier is no need to create object.

Void :-  Void is nothing but we knows that void returns nothing.

String... args:- It is an array which is advanced array used only in 1.5 and in upper version of JDK after JDK 1.5.

System.out.println:-Its is simply a print statement .


 Screenshot of first program output:::.




No comments:

Post a Comment

Explanation of first program of Java

CREATING A SIMPLE JAVA PROGRAM In this page we try to understand java program, and this helps us lot more in building further java progr...