Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From the docs for <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Integer.html#getInteger%28java.lang.String%29" rel="nofollow"><code>Integer.getInteger</code></a>:</p> <blockquote> <p>Determines the integer value of the system property with the specified name. The first argument is treated as the name of a system property. System properties are accessible through the System.getProperty(java.lang.String) method. The string value of this property is then interpreted as an integer value and an Integer object representing this value is returned. Details of possible numeric formats can be found with the definition of getProperty.</p> <p>If there is no property with the specified name, if the specified name is empty or null, or if the property does not have the correct numeric format, then null is returned.</p> </blockquote> <p>In other words, it <em>doesn't</em> parse an integer. To parse an integer, either use <code>Integer.parseInt</code> (to get an <code>int</code>) or <code>Integer.valueOf</code> (to get an <code>Integer</code>).</p> <p>However, even your description is slightly odd - you claim in the title that it's giving you a <code>NullPointerException</code>, but you then say it's printing <code>null</code>. Which is it? They're very different. I can't see how the code you've given us would throw a <code>NullPointerException</code> at <code>Integer.getInteger</code>.</p> <p>Alternatively, if this is a value entered by a user, you may want to use <code>java.text.NumberFormat</code> instead.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload