title: Integer min and max values
body: <p>I am a newbie in programming. I was studying from a Java object programming book and performing the tutorials and examples on the book simultaneously on computer.
  In the book it says that the maximum and minimum value of integers are;</p>
  
  <pre><code>Integer.MAX_VALUE = 2147483647
  Integer.MIN_VALUE = -2147483648
  </code></pre>
  
  <p>So OK. there is no problem here but;
  it says that if we add 1 to the maximum value and subtract 1 from minimum;</p>
  
  <pre><code>class test {
  public static void main(String[] args) {
  
  int min = Integer.MIN_VALUE -1;
  int max = Integer.MAX_VALUE +1;
  
  int a = min - 1;
  int b = max + 1;
  System.out.println("min - 1 =" + a);
  System.out.println("max - 1 =" + b);
  }
  }
  </code></pre>
  
  <p>thus we find;</p>
  
  <pre><code>min - 1 = 2147483646
  max + 1 = -2147483647
  </code></pre>
  
  <p>and it says that this result is because that the binary process in memory which is limited with 32 bit.
  The thing that I couldn't understand. In the piece of code isn't it adding and subtracting 2 respectively from maximum and minimum values?;</p>
  
  <pre><code>    int min = Integer.MIN_VALUE -1; // subtracted 1 here
  int max = Integer.MAX_VALUE +1; // added 1 here
  
  int a = min - 1;  // subtracted 1 here
  int b = max + 1; // added 1 here
  </code></pre>