CS 66-460
Introduction to Graphical Human Machine Interfaces

Java (Part 1)

MONDAY,MARCH 31, 1997

Instructor: G. Bowden Wise
Rensselaer Polytechnic Institute
Spring 1997


Outline


Java Beginnings ...

Java began (in 1990) as ...

Java Beginnings ... (continued)

a foundation for a new product:

   
Sun releases a new computing paradigm (1994):


Java


The Java Platform/Run-Time

   



Java Design Goals


Java: Simple and Familiar

How is this achived?


Hello World!

As a Java program:

   class HelloWorld {
      static public void main (String args[]) {
         System.out.println ("Hello world!");
      }
   }

As a Java applet:

   import java.applet.Applet;
   import java.awt.Graphics;

   public class HelloWorld extends Applet {
       public void paint(Graphics g) {
           g.drawString("Hello world!", 50, 25);
       }
   }


Java: Primitive Data Types


Arrays

Arrays:

Array example:

   Point myPoints[];
   myPoints = new Point[10];

   for (int i=0; i < 10; i++) {
      myPoints[i] = new Point();
   }

   int howMany = myPoints.length();


Strings

have

"Input has " + count + " chars."


Memory Management and Garbage Collection


Features Removed from C/C++


Java Compile and Runtime
Environments

    



The Java Platform

    



The Bytecode Verifier

Prevent hostile applets and/or hostile Java compilers


The Classloader



Bowden Wise
Mon Apr 7 12:15:54 EDT 1997