Implementing a Java Program?

Implementation of a  java  application  program involves  series of  steps. They  include

1.    Creating  a  program.

2.    Compiling  the  program.

3.    Running   the  program.

Creating  the  program :-

 We  can  create  a  program  using  any text editor.Assume   that  we have  entered the  following.

class  Test
{
 public  static  void  main  (String  args[])
{

System. Out. println (“  Hellow”);
System .Out . println (“ welcome to the  world  of  JAVA”);
}

}

We must save  this  program  in a  file  called   Test. java.

This  file  are called  the  source file. Note  that  all java  source  files  will have the  extention “java” .if  a program  contains  multiple classes, the file name  must  be  the  class  name  of  the  class  containing   the main method.

Compiling   the program:-

To  compile  the program  we must  run  the java compiler  java c  with the  name  of  the source file  on the  commend   line as  shown below.

javac Test . java

If  every thing  are ok the java c compiler creates  a file called  Test.class containing  the byte code of  the program. Note that the compiler automatically names the byte code file as .class.

Running the Program:

 we need to use the java interpreter to run a stand alone program.At the  command  prompt  type  

java Test

Now the interpreter  looks  for  the  main  method  in the  program  and  begins  execution from  there.When executed  our  program  displays  the  following output:

Hellow

Welcome  to  the world of  JAVA.
 

Related

Write about Jumps in loops in java

Jumps in loops: Break : [jumping of out of a loop] Break is used to come out of a loop, an early exists from a loop can be accomplished by using break statement. The break statement can be use...

Write about Labeled loops in Java

Labeled loops: In java we can give a label to a block of statements a label is any valid java variable name. to give a label to a loop, place it before the loop with a colon(:) at the end. For...

Explain Java Environment ? (or) Java Development Tool Kit ?

Java environment includes a large number of development tools are part of the system known as java development kit is the classes is methods are part of the java standard lib...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item