As a language, Java was designed to take the good bits of syntax and functionality of C++, but remove the problematic and complex features that made C++ unreliable and difficult to use.
Java's main advantages as a programming language are that it is:
For a good overview of what this means, see the Object-Oriented Programming Concepts: A Primer section in the Java Tutorial.
Java is compiled into bytecodes (similar to the old UCSD Pascal "p-code" system) that allow a single, pre-parsed, non-processor-specific file to be loaded, checked for validity and integrity, and interpreted and executed by a platform-specific "run-time engine," such as that provided in Netscape's Navigator version 2.0 browser and Sun's Hot Java browser. Any web browser could potentially run Java applets, and many will.
For example, the integer types are defined to always be:
Type Size Range ------------------------------------------------------------- byte 8 bits -128 to 127 short 16 bits -32,768 to 32,767 int 32 bits -2,147,483,648 to 2,147,483,647 long 64 bits -9223372036854775808 to 9223372036854775807
Since these types will always conform to is definitine, this means that Java programs will not run into portability problems when used on different operating systems, or architectures, as C and C++ programs can.
Java classes can be extended to include your own Java classes, including those written in native programming languages such as C and C++. In fact, several database vendors are currently working on native classes that will allow Java programs to interact with common database management servers to simplify accessing and processing your existing data.
In March of 1996, Sun released its Java Database Connectvity (JDBC) specification on its Javasoft web site. This specification will allow middleware and "back-end" database server vendors to support integration with Java applications and applets. Several vendors have products in the works that support the JDBC specification.
(See also: The Java Tutorial, Integrating Native Methods into Java Programs)
This is a very simple Java program, that I like to call HelloApp.java.
A more complex example of how to implement a new object type--rational numbers--can be found in Rational.java. This is not a Java applet, but instead a Java class which includes a main() method that can be used to test the class from the command line using the java interpreter.
Here is an applet, RatCalc.java, for calculating rational numbers, which uses the Rational class.
These tools are still somewhat primitive, but they do let you start developing Java applications and applets. A port of the JDK for Linux is available, with another for Digital Unix in the works. (See also: the Javasoft Developer's Corner.)
Sun has promised more extensive tools that allow artists, writers, and other non-propeller-headed Web authors to "speak Java fluently," but the tools are not yet on the horizon.
Other object-oriented software development tool vendors--including Silicon Graphics, Borland, Symantec, start-up Sourcecraft, Inc., Sybase Inc.'s tool division Powersoft Corp., Natural Intelligence--are all coming out with development environments for Java. Expect to find fairly sophisticated Java development tools for MacOS, Windows 95 and NT, Solaris 2.x, HP-UX, AIX, IRIX, and many other operating systems.