ref http://www.javabeginner.com/learn-java/introduction-to-java-programming
Simple Program:
class Hello { public static void main (String[] args) { System.out.println("Welcome to the world of Java Programming."); } // method main } // class Hello
To compile and run this program, you need to have installed JDK and added a line to your path statement referring to the directory of where it was install + \bin. (e.g. path %path%;c:\jdk\bin;)
- type this file into notepad or something
- save it as Hello.java(class name + .java)
- drop to a command prompt
- type javac Hello.java (e.g. "javac C:\work\Hello.java")
- type java Hello (e.g. "java C:\work\Hello")
No comments:
Post a Comment
Thanks for your comments submitted.,will review and Post soon! by admin.