/*
This is a simple Java program.
*/
class Example
{
// program begins with a call to main().
public static void main(String args[]) {
System.out.println("This is a simple Java program.");
}
}

Save this with same name as that of class. In this case it is example.java

Running a program in java takes place in two important steps:

  1. Compiling a program by writing the code javac file-name.java
  2. Running a program by writing the code java file-name


0 comments to "SIMPLE JAVA PROGRAM"

Post a Comment

Powered by Blogger.