• We Code
  • We Design
  • We Develope
  • We Write
  • We Share

menu

Thursday, August 9, 2012

Understanding First Java program

It is the time to move in programming now .After learning the feature of java the next step of java learning is to understand the art of program writing.Here we will go with the simple program and will see how to write a simple program.


================================================================
||       public class hello                                                                                                         ||
||        {                                                                                                                                   ||
||       public static void main{String args[] }throws Exception                                            ||
||       {                                                                                                                                    ||
||      System.out.println("hello this is my first java program");                                         ||
||       }                                                                                                                                    ||
||                                                                                                                                             ||
================================================================
System is in class java.lang package which comes with jdk by default hence we need not have to include  import statement

In System class "out" is a staticvariable for print stream class

in print writer class print() and println() methods are given that they can print any type data type valueit may be an byte short word int long float double char etc.

====================================================================

To compile the above program
javac hello.java

To run the above program
java hello

2 comments:

...