home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-09-10 | 704 b | 40 lines |
- // Copyright(c) 1996 ObjectSpace, Inc.
-
- import jgl.*;
-
- /**
- * Exceptions.
- * <p>
- * @see jgl.Array
- * @version 1.1
- * @author ObjectSpace, Inc.
- */
-
- public class Array5
- {
- public static void main( String[] args )
- {
- Array array = new Array();
- try
- {
- array.popBack();
- }
- catch( InvalidOperationException exception )
- {
- System.out.println( "Caught " + exception );
- }
- array.add( "ape" );
- array.add( "bat" );
- array.add( "cat" );
- try
- {
- array.at( 5 );
- }
- catch( IndexOutOfBoundsException exception )
- {
- System.out.println( "Caught " + exception );
- }
-
- }
- }
-