<div dir="ltr"><div dir="ltr">On Mon, Apr 15, 2024 at 4:27 PM David Alayachew <<a href="mailto:davidalayachew@gmail.com" target="_blank">davidalayachew@gmail.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:monospace">> Java's decision to make the shadowing of normal variables illegal...<br><br>I'm actually confused what you mean here.</div></div></blockquote><div><br></div><div>Sorry, my fault for not being clear - Java only disallows "shadowing" for variables declared in the same method, e.g., like this:</div><div><br></div><div><span style="font-family:monospace">    public void foo(int x) {<br>        while (true) {<br>            float x = 1;     // error: variable x is already defined in method foo(int)<br>            x += 7;<br>        }</span></div><div><span style="font-family:monospace">    }</span><br></div></div><div><br></div><div>But it doesn't prevent variables from overshadowing fields as you point out.<br></div><div><br></div><div>-Archie</div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div></div>