Integer.MAX_VALUE : Integer « java.lang « Java by API






Integer.MAX_VALUE

 
/*
i=32767
i=-32768
i=-32767
i=2147483647
i=-2147483648
i=-2147483647 
 */
public class MainClass {
  public static void main(String[] unused) {
    do_shorts();
    do_ints();
  }
  protected static void do_shorts() {
    short i = Short.MAX_VALUE;
    System.out.println("i=" + i++);
    System.out.println("i=" + i++);
    System.out.println("i=" + i++);
  }
  protected static void do_ints() {
    int i = Integer.MAX_VALUE;
    System.out.println("i=" + i++);
    System.out.println("i=" + i++);
    System.out.println("i=" + i++);
  }
}

           
         
  








Related examples in the same category

1.Integer: MIN_VALUE
2.Integer: Integer.SIZE
3.Integer: bitCount(int i)
4.Integer: equals(Object obj)
5.Integer: highestOneBit(int i)
6.Integer: intValue()
7.Integer: lowestOneBit(int i)
8.Integer: numberOfLeadingZeros(int i)
9.Integer: numberOfTrailingZeros(int i)
10.Integer: reverseBytes(int i)
11.Integer: rotateLeft(int i, int distance)
12.Integer: signum(int i)
13.Integer: toBinaryString(int intValue)
14.Integer: toHexString(int intValue)
15.Integer: toOctalString(int intValue)
16.Integer: parseInt(String stringValue)
17.Integer: valueOf(String stringValue)