Wednesday 4 January 2012

First program in java how to compile and run

              First program in java how to compile and run
 
First program in java how to compile and run for new in java,java first program,compile and run java program,command to compile and run a java program,first program in java how to compile and run
Beginners can easily understand how to compile and run a java program through command promt
first program in java how to compile and run 
First Program
------------------------------------------------------------------------------------------------------------
  class  FirstProgram
{
    public static void main(String[] args)
    {
        System.out.println("This is My Frist Program in Java!");
    }
}






------------------------------------------------------------------------------------------------------------


Steps  to compile and run the above code :

Step1: save the file with the class name 
           ex: FirstProgram.java 

Step2: go to commnad promt  
           
          and go to the path  that is where you have saved FirstProgram.java

          ex:  e:/java/practice/      is your path

          cmd:> cd E:/java/practice/                 press enter
          E:\>java/practice> javac FirstProgram.java       ---------> compile the program
          E:\>java/practice>java FristProgram                  ----------> run the program

           Note:  javac is  java compiler to compile the java program
                      java is commnad to run our java program

    >>> with this we have done our frist program in java












 

No comments:

Post a Comment