/****************************************************/
/* Strings                                          */
/* m.booth                                          */
/* 2004 11 16 modified 11.1 Deital 2003             */
/* ics4m                                            */
/****************************************************/

//import section
import javax.swing.*;

public class StringConstructors
{

   public static void main( String args[] )
   {
      //variables and constants
      String s, s1, s2, s3, s4;//string objects
      String strOutput;//output string objects

      //initialize array and string objects
      char chrArray[] = { 'b', 'i', 'r', 't', 'h', ' ', 'd', 'a', 'y' };
      s = new String( "hello" );
      s1 = new String();
      s2 = new String( s );
      s3 = new String( chrArray );
      s4 = new String( chrArray, 6, 3 );


      // append Strings to output
      strOutput = "s1 = " + s1
                + "\ns2 = " + s2
                + "\ns3 = " + s3
                + "\ns4 = " + s4 ;

      //display constents of string objects
      JOptionPane.showMessageDialog( null, strOutput,
         "String Class Constructors", JOptionPane.INFORMATION_MESSAGE );

      System.exit( 0 );
   }//end main

} // end class StringConstructors
