6 billion cannot be recognized as an integer in java?
<p>I am having problems when I try to store <code>6000000000</code> in an <code>int</code> variable.</p>

<p>This is the part of script I am having problems with:</p>

<pre><code>Scanner x = new Scanner(System.in);
System.out.println("Please enter a number here:");
int k = x.nextInt();
System.out.println(k);
</code></pre>

<p>When I input <code>6000000000</code> the output should be the same, but the output is this error:</p>

<pre><code>Exception in thread "main" java.util.InputMismatchException: For input string: "6000000000"
    at java.util.Scanner.nextInt(Unknown Source)
    at java.util.Scanner.nextInt(Unknown Source)
</code></pre>

<p>What is this? How to prevent this?</p>
