New to Java: Is there a better way to write this simple code
<pre><code>private void addMember() {
    while (true) {
        String mNum = readLine("Please enter a membership number: ");
        if (mNum == null) break;
        Integer mNumAsInteger = Integer.parseInt(mNum);
        String mName = readLine("Please enter the member's name: ");
        members.put(mNumAsInteger, mName);
    }
}

private Map&lt;Integer, String&gt; members = new HashMap&lt;Integer, String&gt;();
</code></pre>

<p>The purpose of the code is to keep adding members until user enter a blank input.</p>

<p>Is there a way to change the first line to something like </p>

<pre><code>Integer mNum = readInt("Please enter a membership number: ");
</code></pre>

<p>And somehow detects a blank input? </p>
