elibraryportal Logo

Simple Program run in Java

There are following step write java program that is...

Step 1 : Open the Notepad

Step 2 : Write the java program on notepad.

Step 3 : Save the program by the class name Test.java, in javaprog folder just like in fig. .

Save the Java Program
Test the Java Program

Step 4 : Open the command prompt.

Step 5 : Run program like in fig.

To compile:    javac Test.java

To execute:    java Test

Run the Java Program

Compilation Flow::

Java program run by this step.

Compilation Flow

Meaning of Java Program

  1. class : It is keyword use of declare a class in java.
  2. public : It is access modifier keyword which represents visibility. It means it is visible to all.
  3. static : It is a keyword. These keyword declare variable, method , block, nested class, as static, it is known as the static.
  4. void : It does not return any value.
  5. main: It represents the start up of the program.
  6. String[] args is used for command line argument.
  7. System.out.println() : It is used to print statement. Here, System is a class, out is the object of PrintStream class, println() is the method of PrintStream class..

Next TopicHow to Set Path