Introduction to Java (1996)

What IS Java?

Java is an object-oriented programming language developed by Sun Microsystems, a company best known for its high-end Unix workstations. Modeled after C++, the Java language was designed to be small, simple, and portable across platforms and operating systems.

Java is often mentioned in the same breath as HotJava, a World Wide Web browser from Sun like Netscape or Mosaic. To demonstrate the power of Java, HotJava was programmed in Java. What makes HotJava different from the older browsers is that, in addition to all its basic Web features, it can also download and play Java-applets on the reader's system. Java-applets are Java-programs that appear in a Web page much in the same way as images do, but unlike images, applets are dynamic and interactive. Applets can be used to create animations, figures, or areas that can respond to input from the reader, games, or other interactive effects on the same Web pages among the text and graphics. The features of Java can be summarized in the following 6 points:

  • Java is object oriented, yet it's still dead simple.
  • The development cycle is much faster, because Java is interpreted. The compile-link-load-test-crash-debug cycle is obsolete - now you just compile and run.
  • The applications are portable across multiple platforms. Write the applications once, and they never need to be ported - they will run without modification on multiple operating systems and hardware architectures.
  • Java-applications are robust because the Java run-time system manages memory for you: the Java run-time system takes advantage of idle periods and runs a garbage collector in the background, which gathers and compacts unused memory, increasing the probability that adequate memory resources are available when needed.
  • Interactive graphical applications have high performance because multiple concurrent threads of activity in your applications are supported by the multithreading built into the Java environment.
  • Java end users can trust that Java-applications are secure, even though they're downloading code from all over the Internet; the Java run-time system has built-in protection against viruses and tampering.

But don't think Java is the perfect programming language! In spite of all the advantages, there are also some other things to mention, for example:

  • Java does not support template classes: this means that it is not possible to create an object which can be used for an arbritary data-type. I think this is a serious lack, which should be the first thing to be added in a newer version of the Java Development Kit.
  • Java programs are relatively slow: performance is degraded because Java code is interpreted by the Java-interpreter. (But this is also the thing that makes Java-programs portable across multiple platforms!)
  • Although the Java run-time system has a built-in protection against viruses, the first rumours about Java-viruses have been heard. This is a serious threat to the future of Java, because Java's future lies at the Internet: Java-virsuses at the Internet could cause terrible damage...


Here's an example of a Java-applet. As mentioned before, a Java-applet is a Java-program which can be executed by a Java capable Internet-browser and offers Web-pages more interactivity and adds the possibility of animations.
I made this applet in a few hours to discover how Java works. In this example you can click the button at the top to switch between two very simple animations.

Your browser does either (1) not support Java, or (2) not have Java enabled.

That is why you cannot see the sample Java applet that would otherwise have been here!