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
No comments:
Post a Comment