Outline of Class 2: Introduction to Java
Held: Tuesday, January 20, 1998
- If you haven't filled out the introductory
survey, please do so soon (i.e., after class).
- I've prepared some short
responses to the questions
on your survey forms.
- Some of you reported trouble getting to
Java Tutorial from
yesterday's outline. Because of copyright
restrictions, the local version is available only from the MathLAN. If
you need to use it elsewhere, you'll need to use the
official version (which takes somewhat longer to load). You can also
find a link to that version on our course front
- We'll come back to object-oriented programming later this week or early
next week. Scan through my notes in
- Java is an object-oriented language developed by Sun Microsystems.
- It was ostensibly developed for developing large programs.
- Many of these programs were to run on autonomous systems, like
- With the popularization of the World-Wide Web, it has also
become popular as a language for creating web
- It is also a reasonably good introductory language.
- Java looks a lot like C and C++, two popular languages. It has many
differences from the two.
- It is object-oriented (which C is not but C++ is)
- It has a different view of object-orientation than C++.
- It provides automatic memory management (yay!).
- We'll see some others as time goes on (some even in the
- Sun says that Java is "a simple, object-oriented, distributed,
interpreted, robust, secure, architecture neutral,
portable, high-performance, multithreaded, and dynamic
- Simple. Compared to many modern languages, there is not
too much to the core of Java. However, a great
deal of functionality exists in the standard libraries,
and you will eventually need to learn those libraries.
- Object-oriented. Java focuses on the creation of classes
and objects. Every Java program begins with a central
class or object.
- Distributed. Java permits you to place different portions
of a program on different servers, to segment
processing between servers, and so on and so forth.
- Interpreted. Although a compiler translates Java code
to another format (byte codes), an interpreter is
required to execute or further translate the byte
- Robust. Java provides a number of facilities for
ensuring that things don't go wrong or that,
when they do, the programmer provides for
- Secure. The Java interpreter will often limit what a
program can do (from accessing the file system to
reading memory outside of a valid range). We often
say that Java gives each program a sandbox
to play in.
- Architecture neutral. A Java program will run
identically (except for speed) on every platform.
Unlike most languages, which can have a different implementation
on every platform, Java has specific requirements for
essentially every part of the language (from the
amount of storage used for various data types to the
algorithms used for numeric computation).
- Portable. See the sections above on architecture neutral and
- Multithreaded. A program can have separate threads of
computation, and it is relatively easy to manage
- Dynamic. New objects can easily be created, and new
classes can be loaded as the program runs.