LongTest.java



/** long型のデータを取り扱う */
public class LongTest {

  /** 処理の開始 */
    public static void main( String[] argv ) {

        long n=9223372036800000000L;
        while( true ) {
           long m = n+1;
           if( m < n ) { 
               System.out.println( "int value = " + n );
               System.out.println( "int value = " + m );
               break;
           }
           n = m;
        }
    }
}