Arraylist remove elements
<p>I have a java code where i have an ArrayList and want to remove element from the arraylist.</p>

<pre><code>   ArrayList &lt;word&gt; wordlist=new ArrayList&lt;&gt;();

   public void removeWord(String inputWord){    
        for(word z:wordlist){               
            if(z.getWord() == inputWord)
                wordlist.remove(inputWord);
            System.out.println("the word" +inputWord+ "is removed");
        }
        System.out.println(wordlist.size());
    }
</code></pre>

<p>the problem is that the element is not getting removed from the list.</p>
