574 Strings and Characters Chapter 10 89 90 (Abyss web server)
574 Strings and Characters Chapter 10 89 90 // execute application 91 public static void main( String args[] ) 92 { 93 StaticCharMethods2 application = new StaticCharMethods2(); 94 95 application.addWindowListener( 96 97 // anonymous inner class 98 new WindowAdapter() { 99 100 // handle event when user closes window 101 public void windowClosing( WindowEvent windowEvent ) 102 { 103 System.exit( 0 ); 104 } 105 106 } // end anonymous inner class 107 108 ); // end call to addWindowListener 109 110 } // end method main 111 112 } // end class StaticCharMethods2 Fig. 10.18 Characterclass staticconversion methods (part 3 of 3). The program in Fig. 10.19 demonstrates the nonstatic methods of class Character the constructor, charValue, toString, hashCodeand equals. 1 // Fig. 10.19: OtherCharMethods.java 2 // Demonstrate the non-static methods of class 3 // Character from the java.lang package. 5 // Java extension packages 6 import javax.swing.*; Fig. 10.19 Non-staticmethods of class Character(part 1 of 2). Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/7/01