HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 1 February 97

Foil 39 Java Language -- Program Structure

From Jan 22 Delivered Lecture for Course CPS616 -- Java Lecture 1 -- Overview CPS616 spring 1997 -- Jan 22 1997. by Nancy McCracken * See also color IMAGE
Secs 61.9
Source code of a Java program consists of one or more compilation units, implemented as files with .java extension.
Each compilation unit can contain:
  • a package statement
  • import statements
  • class declarations
  • interface declarations
Java compiler (called javac) reads java source and produces a set of binary bytecode files with .class extensions, one for each class declared in the source file. For example, if Foo.java implements Foo and Fred classes, then "javac Foo.java" will generate Foo.class and Fred.class files.
Suppose that Foo implements an applet and Fred is an auxiliary class used by Foo. If HotJava/Netscape encounters a tag <APPLET code="Foo.class">, it will download Foo.class and Fred.class files and it will start interpreting bytecodes in Foo.class.


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Feb 16 1997