Remove value arraylist java from input : <p>I have an array like this:</p>

<pre><code>1101 "TV"
5531 "Baju Baru"
1425 "Mesin Cuci"
</code></pre>

<p>Then i want to remove "TV" from my Arraylist. So i must type "1101" then the value is remove. But if i'm wrong it show "code is invalid".</p>

<p>Here is my code:</p>

<pre><code>for (int i = 0; i &lt; listBarang.size(); i++) {
    System.out.println(listBarang.get(i));
}
System.out.println("Your code stuff: ");
int code = Integer.parseInt(input.next());
listBarang.remove(i);
</code></pre>

<p>Any answer?</p>
