title: Multiplying two large integer values gives incorrect result
body: <p>This method is for getting (By input from user) the two largest Integers in the given data set and calculates their product. It works well for every input until I tried the array of two integers <code>100000</code> and <code>90000</code> where it returns <code>410065408</code>.</p>
  
  <p>This is my Java method:</p>
  
  <pre><code>static int getMaxPairwiseProduct(int[] numbers) {
      int max=0,lessermax=0;
      int n = numbers.length;
  
      for (int j = 0; j &lt; n; ++j) {
          //if(j==k)continue;
          if(numbers[j]&gt;0 &amp;&amp; numbers[j]&gt;=max) {               
              lessermax=max;max=numbers[j];
              System.out.println(j);//k=j;
          } else if(numbers[j]&gt;lessermax) {      
              lessermax=numbers[j];
              System.out.println(j);}
          }
      //result=;
      return max*lessermax;
  }
  </code></pre>
  
  <p>This is my <code>main</code> method:</p>
  
  <pre><code>public static void main(String[] args) {
      //FastScanner scanner = new FastScanner(System.in);
      Scanner scanner=new Scanner(System.in);
      int n = scanner.nextInt();
      int[] numbers = new int[n];
      for (int i = 0; i &lt; n; i++) {
          numbers[i] = scanner.nextInt();
      }
      scanner.close();
      System.out.println(getMaxPairwiseProduct(numbers));
  }
  </code></pre>