Introduction to Java (in plain English)

A look at what Java promises -- and delivers

What's more powerful than a double espresso? Faster than a speeding Jamaican Blue Mountain special? Able to leap latte grandes in a single bound?

It's Java from Sun Microsystems. Coming from a different Sun, the way cool Java programming language is muscling its way onto the Internet with powers beyond those of mortal computer languages. Flying on the vapor trails of the booming World Wide Web (WWW) service across the ubiquitous Internet, Java is not just a mild-mannered computer programming language working in a metropolitan area network. The technology represented by Java holds the promise of a totally new way of providing products and services to consumers and promises truth, justice and an effective way of programming the information superhighway.

The frenzy

Few would argue with Java's reputation as a useful and promising technology. But why is it white hot? (After all, there are lots of useful-and-promising-technologies around.) The answer: Timing. The success of any innovation depends just as much on its market and political, socio-economic timing as on its creativity and utility. Some call it serendipity; some call it plain luck. For example, Elvis and the Beatles had obvious talent, but the enormity of their popularity resulted from surfing a few key waves. Elvis rescued the United States from its postwar doldrums and the Fab Four took us out of the malaise and constraints of the 1950s. Java performs a similar favor by liberating the software community from the battles of the late 1980s and the tedium of the early 1990s.

The immense popularity of Java is a confluence of many circumstances, such as developers sick of the complexity and largess of C++; PC programmers tired of dealing with an arcane OLE and goofy Hungarian notation; window mavens ho-humming Motif and X Window; corporate IT architects complaining of the awkwardness of writing multi-platform software; programmers weary of developing distributed applications with RPC and XDR; users and advertisers worrying about the lack of interactivity and security with the Web; hardware vendors drooling over the idea of ubiquitous computing devices; and probably not least of all, the growing anti-Microsoft sentiment (after all, it's human nature to root for the little guy, and there's nothing little about Microsoft).

Hypermedia + interactivity = hyperactivity

Imagine that there is a system that allows one to interact with all sorts of applications on the Internet. And not only does this system allow you to write programs that run over the Internet, it also provides a high degree of security to programs and users, protects programmers from their own mistakes and offers neat multimedia functionality to display images, play audio and video clips. But wait, there's more! This ideal technology also runs on many different types of machines like PCs, Macintoshes and powerful Sun workstations -- without any additional programming wizardry. Heck, it even will run on machines that haven't been invented yet!

This is what Java technology promises, but does it deliver the goods?

Java is a general-purpose, object-oriented computer programming language that offers special features that allow programs to take advantage of the power and flexibility of the Internet.

Apps and AppNots

There are four different types of programs you can write using Java: applications, applets, content handlers, and protocol handlers.

Java applications are standalone programs that require the assistance of the Java interpreter to run. The HotJava Web browser is an example of a Java application. On a Solaris machine, the "HotJava" program is actually a shell script wrapper that invokes the Java interpreter (Java) with the "compiled" HotJava application code (i.e., its class file) as an argument. Java applications are analogous to C/C++ applications; they run independently of any Web browser.

Java applets are small applications that are embedded on Web pages. Applets are more security-conscious than Java applications; there are many restrictions on the behavior of applets. For example, unlike applications, applets cannot dynamically link in older C or C++ code. A Java applet requires a browser (or another Java application) to run. Java applets are given a piece of screen real estate in which to draw and a thread of execution, and require the use of another Java program (such as a browser) to actually run.

The remaining two types of Java programs, content and protocol handlers, are special-purpose Java programs that allow Web browsers to dynamically understand new data types such as QuickTime movies, voice recognition or PhotoCD data and new protocols like MIDI or a proprietary stock trading protocol. These types of Java programs make it possible for Java-compliant web browsers to dynamically handle new types of data on the fly. Got a cool site that's offering music in MIDI format, but your browser doesn't know how to handle it? No problem if you have Java. The MIDI handler would be downloaded to your browser along with the data for the handler. Handlers are similar in philosophy to "helper apps" in Netscape, except they are infinitely more secure.

While not as popular as Java applications and applets, handlers are critical components for internet appliances. They would allow new and safe behavior to be added dynamically to a consumer product that would be a maintenance and security nightmare if implemented in a more rigid technology.

1 2 Page 1
Page 1 of 2