Source of PlusFlagTest.java


  1: // Fig. 28.16: PlusFlagTest.java
  2: // Printing numbers with and without the + flag.
  3: 
  4: public class PlusFlagTest 
  5: {
  6:    public static void main( String args[] )
  7:    { 
  8:       System.out.printf( "%d\t%d\n", 786, -786 );
  9:       System.out.printf( "%+d\t%+d\n", 786, -786 );
 10:    } // end main 
 11: } // end class PlusFlagTest
 12: 
 13: 
 14: /**************************************************************************
 15:  * (C) Copyright 1992-2005 by Deitel & Associates, Inc. and               *
 16:  * Pearson Education, Inc. All Rights Reserved.                           *
 17:  *                                                                        *
 18:  * DISCLAIMER: The authors and publisher of this book have used their     *
 19:  * best efforts in preparing the book. These efforts include the          *
 20:  * development, research, and testing of the theories and programs        *
 21:  * to determine their effectiveness. The authors and publisher make       *
 22:  * no warranty of any kind, expressed or implied, with regard to these    *
 23:  * programs or to the documentation contained in these books. The authors *
 24:  * and publisher shall not be liable in any event for incidental or       *
 25:  * consequential damages in connection with, or arising out of, the       *
 26:  * furnishing, performance, or use of these programs.                     *
 27:  *************************************************************************/