Implementation of a java application program involves a series. They include Creating the program, compiling the program, running the program. Here the detailed explanation of each and every step.
we can create a program using any text editor. Assume that we have entered the following program.
Ex: Test.java
Class Test
{
public static void main(String args[])
{
System.out.println(" Hello!");
System.out.println(" Wecome to the world of java ");
System.out.println(" Let us learn java");
}
}
save the file name with the class name that will appear above the main method, with .java extension.
To compile the program, we must run the java compiler javac, with the name of the source file on the command line as shown below.
If everything is ok, the javac compiler creates a file called Test.class containing the bytecode of the program.
We need to use the java Interpreter to run a standalone program. All the command prompt, type
Now, the interpreter looks for the main method in the program and begins execution from there. When execution, our program displays the following
- Creating the program
- Compiling the program
- Running the program.
1.Creating the program
we can create a program using any text editor. Assume that we have entered the following program.
Ex: Test.java
Class Test
{
public static void main(String args[])
{
System.out.println(" Hello!");
System.out.println(" Wecome to the world of java ");
System.out.println(" Let us learn java");
}
}
save the file name with the class name that will appear above the main method, with .java extension.
2.Compiling the program
To compile the program, we must run the java compiler javac, with the name of the source file on the command line as shown below.
javac Test.java
If everything is ok, the javac compiler creates a file called Test.class containing the bytecode of the program.
3. Running the program.
We need to use the java Interpreter to run a standalone program. All the command prompt, type
Java Test
Now, the interpreter looks for the main method in the program and begins execution from there. When execution, our program displays the following
Hello!
Welcome to the world of java.
Let us learn Java.
0 comments :
Post a Comment
Note: only a member of this blog may post a comment.