 <pre><code>&lt;% String language = "EN"; Lang lang; if (language.equals("EN")){ lang = new EN(); } else if (language.equals("FR")){ lang = new FR(); } %&gt; </code></pre> <p>Here it can be the case where language stays un initialized so you need to initialize it </p> <p>say </p> <pre><code>Lang lang = null;//or any default value </code></pre> <p>And to initialize local variable is compulsary </p> <p>I don't understand the importance of this condition here you are assigning <code>"EN"</code> to language then what is the need of condition?</p>