02 - The Hello World Application
02 - The Hello World Application
Java
Summer 2008 Instructor: Dr. Masoud Yaghini
Outline
Introduction Creating Your First Application A Closer Look at the "Hello World!" Application References
Introduction
You can download the Windows version of JDK6 from: http://java.sun.com/javase/6/download.jsp We use a text editor to create and edit source files. We will can use Notepad, a simple editor included with the Windows platforms.
Click Start > Control Panel > System on Windows XP or Start > Settings > Control Panel > System on Windows 2000. Click Advanced > Environment Variables. Add the location of bin folder of JDK installation for PATH in User Variables and System Variables.
Compile the Source File into a .class File If you enter dir at the prompt, you should see your source file:
The Hello World Application A Closer Look at the "Hello World!" Application
The Hello World Application A Closer Look at the "Hello World!" Application
Source code comments, The HelloWorldApp class definition, and The main method.
The following explanation will provide you with a basic understanding of the code
The Hello World Application A Closer Look at the "Hello World!" Application
/* text */
The compiler ignores everything from /* to */.
/** documentation */
This indicates a documentation comment (doc comment, for short). The compiler ignores this kind of comment, just like it ignores comments that use /* and */. The javadoc tool uses doc comments when preparing automatically generated documentation.
// text
The compiler ignores everything from // to the end of the line.
References
References
S. Zakhour, S. Hommel, J. Royal, I. Rabinovitch, T. Risser, M. Hoeber, The Java Tutorial: A Short Course on the Basics, 4th Edition, Prentice Hall, 2006.
The End