Java Programs

You must set path variable to compile and run java programs as follows: PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Java\jdk1.7.0_25\bin
then must restart your computer.

to run java program type :
c:\myjavaprog>javac hello.java

The javac compiler creates a file called hello.class that contains the bytecode version of the program.
The java bytecode is the intermediate representation of your progrtam that contains instuction the java interpreter will execute.
So the output of javac, bytecode is not code that can be directly executed.
To run the java program, you must use the java interpreter, called java.exe.
c:\myjavaprog>java hello

Java Comments:
/* this is multiline comment of java,
as like C and C++,
Lot of syntax of java is same as C
but there are lot different at some point.
eg. string and character data is handle differently in java.
Code of java must reside in class.
java is case sensitive language
name of the program file of java and name of the class which has main function, must be same.
multiline comment ends here*/

}
}
}
to compile : javac Armstrong.java
to Run:
java Armstrong
output is : 1 is an armstrong no
2 is an armstrong no
3 is an armstrong no
4 is an armstrong no
5 is an armstrong no
6 is an armstrong no
7 is an armstrong no
8 is an armstrong no
9 is an armstrong no
153 is an armstrong no
370 is an armstrong no
371 is an armstrong no
407 is an armstrong no
1634 is an armstrong no
8208 is an armstrong no
9474 is an armstrong no
54748 is an armstrong no
92727 is an armstrong no
93084 is an armstrong no
548834 is an armstrong no