Too many if statements in JAVA : <p>Hello I'm trying to make a java program where a user can enter different commands and this class can identify all the commands and based on that it calls methods from 3-4 different classes. currently for each command I have different if statements as such:</p>

<pre><code>if (input.equals("change category FOOD"){...}
if (input.equals("Sort by price FOOD"){...}
if (input.equals("logout"){...}
</code></pre>

<p>There are so many commands, and I wanted to know if there is a way to shorten this up.</p>
