Procedure to develop, Save, Compile and Execute a java program

315 views.

Step1:

Developing a java program:

To develop a java program we require an editor like notepad, WordPad, vi editor etc..

Program1:

Step2:

Saving a java program:

A java program can be saved with any name but the extension must be .java

Ex: FirstProgram.java

Step3:

Compiling a java program

To compile java program we require a command prompt and we use “javac” Command.

Syntax: javac programname/filename with extension

Example: javac FirstProgram.java

java complier will take program and verifies whether the java code is valid or not, if valid the java compiler generates .class file. The .class file generated by the compiler will be given to the JVM for execution.

Step4:

Executing a java program:

To execute a java program we require a command prompt and we use java command.

syntax: java ClassName without extension

Example:  java FirstProgram

Output: 

Welcome to to Java @ AndroIndian

 

 

 

Leave a Reply