Industrial Training

JDK 1.1 - New Features



There are a large number of changes from JDK 1.02 to JDK 1.1. To get an idea of just how much new functionality has been added, consider that:

  • the number of packages increased from 8 to 23; and
  • the number of classes increased from 211 to 503.

Because of the magnitude of the changes, it is possible only to provide a brief overview in most cases.

 

JDK 1.1 - Language Features: Nested Classes
A nested class is a class definition contained within another class. The first type of nested class described below is actually a top-level class. The remaining three types are inner classes:

  • Top Level Class or Interface - These must be defined as static members of the enclosing class. Primarily used as an organizational tool to group together like classes.
  • Member Class - This is a class defined within another class but without the static modifier. It is primarily used as a helper class for a top-level class.
  • Local Class - This is a class defined within a block of code; i.e., either a method or a static initializer. One common use of the local class is to create an event listener for the new Java event model.
  • Anonymous Class - This is essentially the same as a local class except that it is unnamed. We might use an anonymous class over a local class in the case that your class definition was short and the class was used only once.

 

JDK 1.1 - Language Features: Blank Finals
A blank final is a final variable declared without an initializer. This final variable may be initialized once at a later time based on input arguments or computational results.

 

JDK 1.1 - Language Features: Reflection
Reflection refers to the ability of a class to look inside itself and to determine the constructors, methods and fields used. This feature is supported through enhancements to the "java.lang.Class" class and also the new package "java.lang.Reflect".

JDK 1.1 - Utility Features: Big Numbers
The new package java.math includes two classes, BigInteger and BigDecimal. The BigDecimal class provides support for immutable, arbitrary-precision, signed decimal numbers. This support includes the basic arithmetic operations, scale manipulation, comparison, format conversion and hashing. The user has complete control over the rounding behaviour. The BigInteger class provides support for immutable arbitrary-precision integers. This class includes all of the operations available to the primitive integer type and also GCD calculation and prime testing. This class was implemented to meet the needs of cryptography.

 

JDK 1.1 - Security
JDK 1.1 includes a new security package. This package provides the classes and interfaces which represent the basic needs of cryptographic security: public and private keys, certificates, message digests and digital signature. The package includes a default implementation; however, vendor specific implementations may also be used.
Under JDK 1.0, there was a long list of restrictions on what an applet could do. Under JDK 1.1, it is possible to circumvent these restrictions by putting an applet in a JAR file and signing the applet.

 

JDK 1.1 - JDBC
JDK 1.1 includes the package java.sql which provides a call-level SQL interface, JDBC, to a wide range of SQL databases. This interface is similar to that provided by ODBC. In order to facilitate SQL access to any database which supports ODBC, there is also a JDBC/ODBC bridge product which was jointly developed by JavaSoft and Intersolv. Since version 2.1.2, DB/2 has provided JDBC access.

 

JDK 1.1 - RMI
RMI stands for remote method invocation. This facility enables a Java program running on one platform to invoke the methods of a Java program running on another platform. Java applications have always been able to communicate with each other through the TCP/IP socket interface. However, this is still a rather low-level approach and requires the development of a communication protocol. The purpose of RMI is to provide a higher level of abstraction. The use of remote method calls enables distributed applications written in Java to be completely object oriented; and objects can be placed on the network in the most appropriate location.

 

 

JDK 1.1 - AWT Enhancements
A large number of enhancements were made to the AWT in order to provide a more robust and feature-rich environment for GUI development. The following features are currently available:

 

Java Beans Compliant
All AWT components are JavaBean compliant. From the theoretical perspective, this means that they have a consistent API and they use the delegation event model discussed below. From a practical perspective, it means that they can be incorporated by a builder tool just like any other bean.
A side effect of this enhancement is the large number of deprecated methods. In order to comply with the naming patterns defined for JavaBeans, the various "setter" and "getter" method names had to be changed. For example, the component methods show and hide were changed to setVisible(true) and setVisible(false), respectively.Lightweight Components
The original AWT implementation was peer-based. The advantage of this approach was that it enabled the rapid deployment of the AWT and provided components with the same look and feel as the native platform. However, with the spread of Web Browser use, a common look and feel has become desirable. The new lightweight components are "peerless" and completely written in Java. This new framework will enable component developers to provide a wide range of components that look and feel the same across all platforms.

 

Delegation Event Model
The 1.02 event model required subclassing components in order to monitor events. The new 1.1 event model is based on the concept of event sources and listeners. Any component that you create can be an event source. Different types of components generate only certain events; e.g., a button generates an "ActionEvent" when you click it. In order to listen for the event, you must implement the interface which is associated with the type of event; e.g., an "ActionListener". Then you must request that the component add you to its list of listeners. When an event occurs, the component will notify each of its listeners.
In many cases, small classes called "adapters" are used to listen for events. JDK 1.1 provides a set of these adapters in order to simplify the interface implementation. Inner classes are frequently used to subclass the appropriate adapter class.Printing
Printing under JDK 1.1 is implemented through the new PrintJob class and the PrintGraphics interface. When the user requests a print out, the PrintJob class is invoked which displays a platform specific dialog box to assist the user in selecting the appropriate print options. The getGraphics method of PrintJob returns a Graphics object which can be used for printing. This object also implements the PrintGraphics interface. To actually print the component, you simply pass the object to the component's print() method. If such a method does not exist, then the paint() method is used by default. The printAll() method is intended to print the component and all subcomponents.

 

Cut-And-Paste
The cut and paste facilities of JDK 1.1 are provided through the new package, java.awt.datatransfer. This package provides generic data transfer functionality as well as the specific classes and interfaces required to implement the clipboard based cut-and-paste facility. The generic functionality may eventually be used to implement drag and drop.Desktop Colors Integration
Under JDK 1.1, the new SystemColor class provides support for determining the colors currently in use by the system. This is done through a large number of constants; e.g., SystemColor.desktop or SystemColor.menu.

 

Graphics and Image Enhancements

Under JDK 1.1, various methods have been added related to clipping, scaling, and flipping images. Also new methods have been added to make it easier to dynamically update an image in memory.

 

Hi I am Pluto.