The Java TM Tutorial

| Start of Tutorial > Start of Trail > Start of Lesson | Search

Trail: To 1.1 -- And Beyond!
Lesson: Migrating to 1.1

## Classes New for 1.1

### Changes Across All Packages

> Although the basic mechanism for exception handling did not change for the JDK 1.1, many new exception and error classes were added to JDK for 1.1. For the sake of brevity and deadlines, we do not list them here.

### Additions to `java.lang`

> Three new data type wrapper classes were added to the java.lang package in the JDK 1.1:
> - `Byte`
> - `Short`
> - `Void`
> `Byte` and `Short` are subclasses of `Number` and are similar to the other data type wrapper classes such as `Integer`. `Void` was added for completeness and is a subclass of `Object`. `Void` is used by the reflection methods to represent `void` return types.

> The tutorial does not cover these classes. They will be covered in the second edition of The Java Language Specification and are covered online in the `javadoc`-generated API documentation.

### Additions to `java.io`

> The `java.io` package has been extended with character streams, which are like byte streams except that they read and write 16-bit Unicode characters rather than eight-bit bytes. Additionally, `java.io` has been extended to support object serialization.

> The new classes are:

> - `BufferedReader` and `BufferedWriter`
> - `CharArrayReader` and `CharArrayWriter`
> - `FileReader` and `FileWriter`
> - `FilterReader` and `FilterWriter`
> - `InputStreamReader`
> - `LineNumberReader`
> - `ObjectInputStream` and `ObjectOutputStream`
> - `ObjectStreamClass`
> - `OutputStreamWriter`
> - `PipedReader` and `PipedWriter`
> - `PrintWriter`
> - `PushbackReader`
> - `Reader` and `Writer`
> - `StringReader` and `StringWriter`

> The new interfaces are:

> - `Externalizable`
> - `ObjectInput`
> - `ObjectInputValidation`
> - `ObjectOutput`
> - `Serializable`
> All of the I/O classes, including the new character streams, are covered in Input and Output Streams.

### Additions to `java.util`

> Eight classes were added to `java.util` to support internationalization:
> - `Calendar`
> - `GregorianCalendar`
> - `ListResourceBundle`
> - `Locale`
> - `PropertyResourceBundle`
> - `ResourceBundle`
> - `SimpleTimeZone`
> - `TimeZone`
> Our online trail Internationalization contains information about writing Java programs that are independent of users' language and culture.

> Two classes were added to `java.util` to support event handling:

> - `EventListener`
> - `EventObject`

### Additions to `java.net`

> Three classes and one interface were added to the `java.net` package:
> - `DatagramSocketImpl`
> - `HttpURLConnection`
> - `MulticastSocket`
> - `FileNameMap` (an interface)

> Broadcasting Information to Multiple Recipients provides an example of using a `MulticastSocket`. The other classes and interfaces are not covered in this tutorial.

### Changes to `java.applet`

> The basic applet API hasn't changed, except for the addition of an attribute, `ARCHIVE`, to the `<APPLET>` tag. With the help of the new `ARCHIVE` attribute, you can tell browsers to load your applet's files from Java archive (JAR) files. Using JAR files can significantly reduce applet loading time and help you work around unnecessary security restrictions.

> Since applets can use most of the classes in the JDK, most of the changes described in other trails apply to applets, as well. Applets are probably most affected by the 1.1 changes to the AWT (see the next section). Another significant change is that signed classes make it possible to create trusted applets (depending on browser support).

| Start of Tutorial > Start of Trail > Start of Lesson | Search