New to Java? We'll help you get started with our revised beginner's tutorial, or our free online textbook.
|
Get the latest Java books |
|
h t t p : / /w w w . j a v a c o f f e e b r e a k . c
o m /
|
Menu Articles Using Java Applets Looking for Java resources? Check out the Java Coffee Break directory! |
Getting started with Java"A beginner's guide to Java programming"Writing your first Java applicationLike any other language, Java programming starts with writing source code. Source code are instructions that will be followed by the computer. We can create source code using any standard text editor, such as 'notepad' on Windows, or 'vi' on Unix. All Java source code ends in a '.java' extension. Our first application will be extremely simple - the obligatory "Hello World". If you've never heard of "Hello World" before, its a common programming exercise when learning a new language. This example will display the words "Hello World" when executed. class myfirstjavaprog { public static void main(String args[]) { System.out.println("Hello World"); } } Code : myfirstjavaprog.java You should type this code out, using your preferred text editor, and save it as 'myfirstjavaprog.java'. Place this file in a directory (for example, "c:\src\") of its own, not your Java installation directory. Its best to keep your tools and source code separate.
|
||||
|