package chapter29;

// FieldWidthTest.java
// Right justifying integers in fields.

public class FieldWidthTest
{
    public static void main( String args[] )
    {
        System.out.printf( "%4d\n", 1 );
        System.out.printf( "%4d\n", 12 );
        System.out.printf( "%4d\n", 123 );
        System.out.printf( "%4d\n", 1234 );
        System.out.printf( "%4d\n\n", 12345 ); // data too large

        System.out.printf( "%4d\n", -1 );
        System.out.printf( "%4d\n", -12 );
        System.out.printf( "%4d\n", -123 );
        System.out.printf( "%4d\n", -1234 ); // data too large
        System.out.printf( "%4d\n", -12345 ); // data too large
    } // end main
} // end class RightJustifyTest
