Sunday, 4 December 2016

Basic Java Program

import java.lang.*;    //not necessary to include this line because its a default package

class Sample
{
      public static void main(String []s)
     {
                 System.out.println("Welcome");
     }

}


.......................

Note : Save this program as Sample.java

If you want to execute this program you need to install JDK and JRE ...


after installation set path : then run by using this steps


compile : javac Sample.java //javac filename.java

run : java Sample                  // java classname

No comments:

Post a Comment

Featured post

Development Of JAVA Program