Adapted from the Java Tutorial ...

What Is Java?

Java is two things: a programming language and a platform.

The Java Programming Language

Java is a high-level programming language that is all of the following:

  • Simple
  • Architecture-neutral
  • Object-oriented
  • Portable
  • Distributed
  • High-performance
  • Interpreted
  • Multithreaded
  • Robust
  • Dynamic
  • Secure
  • Each of the preceding buzzwords is explained in The Java Language Environment white paper, by James Gosling and Henry McGilton.

    Java is also unusual in that each Java program is both compiled and interpreted. With a compiler, you translate a Java program into an intermediate language called Java bytecodes--the platform-independent codes interpreted by the Java interpreter.

    With an interpreter, each Java bytecode instruction is parsed and run on the computer. Compilation happens just once; interpretation occurs each time the program is executed. This figure illustrates how this works.

    You can think of Java bytecodes as the machine code instructions for the Java Virtual Machine (JVM or Java VM).

    Every Java interpreter, whether it's a Java development tool or a Web browser that can run Java applets, is an implementation of the JVM. The JVM can also be implemented in hardware.

    Java bytecodes help make "write once, run anywhere" possible. You can compile your Java program into bytecodes on any platform that has a Java compiler. The bytecodes can then be run on any implementation of the JVM.

    The Java Platform

    A platform is the hardware or software environment in which a program runs. The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other, hardware-based platforms.

    The Java platform has two components:

    The JVM is the base for the Java platform and is ported onto various hardware-based platforms.

    The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries (packages) of related components.

    The following figure depicts a Java program, such as an application or applet, that's running on the Java platform. As the figure shows, the Java API and Virtual Machine insulates the Java program from hardware dependencies.

    As a platform-independent environment, Java can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and just-in-time bytecode compilers can bring Java's performance close to that of native code without threatening portability.

    Here is a what the whole process of Java development and execution looks like:

    What Can Java Do?

    Probably the most well-known Java programs are Java applets. An applet is a Java program that adheres to certain conventions that allow it to run within a Java-enabled browser.

    However, Java is not just for writing cute, entertaining applets for the World Wide Web ("Web"). Java is a general-purpose, high-level programming language and a powerful software platform. Using the generous Java API, you can write many types of programs.

    A standalone program that runs directly on the Java platform is called a Java application. A special kind of application known as a server serves and supports clients on a network. Another specialized program is a servlet. Servlets are similar to applets in that they are runtime extensions of applications. Instead of working in browsers, though, servlets run within Java servers, configuring or tailoring the server.

    How does the Java API support all of these kinds of programs? With packages of software components that provide a wide range of functionality. The core API is the API included in every full implementation of the Java platform. The core API gives you the following features:

    Java not only has a core API, but also standard extensions. The standard extensions define APIs for 3D, servers, collaboration, telephony, speech, animation, and more.

    How Will Java Change My Life?

    Note: "We" = JavaSoft, Sun Microsystems

    We can't promise you fame, fortune, or even a job if you learn Java. Still, Java is likely to make your programs better and requires less effort than other languages. We believe that Java will help you do the following: