title: How to use labels in java code?
body: <p>I am getting error while using break statements in labels in java code. This is showing <code>undefined label</code>. It is wrong to write code like this. Please assist me in using it correctly. Thanks in advance.</p>
  
  <pre><code> while (true)
            {
              label149: if (!localIterator2.hasNext());
              while (true)
              {
                i++;
                break;
                HashMap localHashMap2 = (HashMap)localIterator2.next();
                if (!((String)localHashMap1.get("name")).equalsIgnoreCase((String)localHashMap2.get("emotion")))
                  break label149;
                if (!((String)localHashMap2.get("IS_paid")).equalsIgnoreCase("1"))
                  break label246;
                ((HashMap)Saved.this.keynamedata.get(i)).put("is_paid", "1");
              }
              label246: ((HashMap)Saved.this.keynamedata.get(i)).put("is_paid", "0");
            }
  </code></pre>