free ebooks



105 Computers & InternetProgramming > Java  
Brewing Java A Tutorial

Java has caused more excitement than any development on the Internet since Mosaic. Everyone, it seems, is talking about it. Unfortunately very few people seem to know anything about it. This tutorial is designed to change that.

People are excited about Java because of what it lets them do. Java was the first way to include inline sound and animation in a web page. Java also lets users interact with a web page. Instead of just reading it and perhaps filling out a form, users can now play games, calculate spreadsheets, chat in realtime, get continuously updated data and much, much more.

Here are just a few of the many things Java can do for a web page:

  • Inline sounds that play in realtime whenever a user loads a page
  • Music that plays in the background on a page
  • Cartoon style animations
  • Realtime video
  • Multiplayer interactive games

However Java is more than just a web browser with special features. All of these features can be integrated into browsers in other ways. Although HotJava was the first browser to include inline sound and animation, Microsoft's Internet Explorer 2.0 and Netscape Navigator 2.0 support these features in several different ways. What makes Java special?

Java is a programming language for distributed applications. It doesn't just allow you to add new types of content to your pages like Netscape and Internet Explorer do. Rather it lets you add both the content and the code necessary to interact with that content. You no longer need to wait for the next release of a browser that supports your preferred image format or special game protocol. With Java you send browsers both the content and the program necessary to view this content at the same time!

Let's think about what this means for a minute. Previously you had to wait for all the companies that make the web browsers your readers use to update their browsers before you could use a new content type. Then you had to hope that all your readers actually did update their browsers. Java compatibility is a feature that any browser can implement and by so doing implement every feature!

For instance let's say you want to use EPS files on your Web site. Previously you had to wait until at least one web browser implemented EPS support. Now you don't wait. Instead you can write your own code to view EPS files and send it to any client that requests your page at the same time they request the EPS file.

Or suppose you want people to be able to search your electronic card catalog. However the card catalog database exists on a mainframe system that doesn't speak HTTP. Before Java you could hope that some browser implemented your proprietary card catalog protocol; (fat chance) or you could try to program some intermediate cgi-bin on a UNIX box that can speak HTTP and talk to the card catalog, not an easy task. With Java when a client wants to talk to your card catalog you can send them the code they need to do so. You don't have to try to force things through an httpd server on port 80 that were never meant to go through it.

If that were all Java was, it would still be more interesting than a <marquee> or <frame> tag in some new browser beta. But there's a lot more. Java is platform independent. A Java program can run equally well on any architecture that has a Java enabled browser. With the release of Netscape Navigator 2.0 that includes Windows 95, Windows NT, the MacOS, Sun Solaris, Sun OS 4.1.3, SGI IRIX, OSF/1, HP-UX with more to come. But wait. There's more!

Java isn't just for web sites. Java is a programming language that lets you do almost anything you can do with a traditional programming langauge like Fortran or C++. However Java has learned from the mistakes of its predecessors. It is considerably cleaner and easier to use than those languages.

As a language Java is

Java has the bare bones functionality needed to implement its rich feature set. It does not add lots of syntactic sugar or unnecessary features.

Almost everything in Java is either a class, a method or an object. Only the most basic primitive operations and data types (int, for, while, etc.) are at a sub-object level.

Platform Independent
Java programs are compiled to a byte code format that can be read and run by interpreters on many platforms including Windows 95, Windows NT, and Solaris 2.3 and later.

Java code can be executed in an environment that prohibits it from introducing viruses, deleting or modifying files, or otherwise performing data destroying and computer crashing operations.

High Performance
Java can be compiled on the fly with a Just-In-Time compiler (JIT) to code that rivals C++ in speed.

Java is inherently multi-threaded. A single Java program can have many different things processing independently and continuously.


 Additional Info
 No. 263
 Posted on 8 June, 2006
Bookmark This Page
Facebook Twitter stumbleupon


Link to us from your website or blog by using the code below in your html
@2008 ebooklobby privacy policy email: info [at]