can be done after reading this tutorial.
Java began life as a programming language for software for consumer electronics- devices such as toasters, and microwaves. Most research went into building small, reliable, safe, long lived, processor independent, real-time, and distributed systems. C++ was insufficient because it was processor dependent. A program written in C or C++ must be compiled for a particular computer chip. When a new chip comes out, the program must be recompiled. The complexity of C and C++ makes it extremely difficult to write reliable software.
Then the World Wibe Web happened, and the Java developers realized that an architectural-neutral language like Java would be ideal for programming on the internet. A program could run on all of the different types of computers connected to the internet.
In "The Java Language: A White Paper," Sun describes Java as follows:
One downside is that Java runs slower than native C or C++. However, Java code will run unaltered (!) on any other Java platform, like Solaris, HPUX, Mac, Windows 95/NT, Linux, SGI, and OS/2. Furthermore, just-in-time compilers and Java-chips are being developed that will eliminate the performance gaps.
Before we look at some Java programs and try to compile them, let's first look at the language and syntax a bit closer.
Java programs come in two varieties: stand-alone applications and applets.
A stand-alone application has a main (like C and C++) method. A Java applet is a Java program that can be embedded in another application. An applet has no main method, and is designed to run in a Java compliant browser, like HotJava, Appletviewer, or Netscape.
Now that we know all this information, let's try it ourselves! Before we can proceed, we need to get the Java Developers Kit (JDK) from Sun and install it.
JDK is available at
Documentation for JDK is available in two forms: on-line and downloadable.
The 1.0.2 release of the Java Developers Kit contains (for a description see):
JDK is available on these platforms (for deatils see http://java.sun.com/devcorner.html):