Page 1 of 1

About Question enthuware.jwpv6.2.1097 :

Posted: Wed Dec 17, 2014 12:42 pm
by shareef.hiasat

Code: Select all

int sum = 0; //this shadows the instance variable, but it is not illegal.
doesnt the above code give compiler error because of overlapped variables ?!

thanks admin

Re: About Question enthuware.jwpv6.2.1097 :

Posted: Wed Dec 17, 2014 7:48 pm
by admin
No, that is how the language designers designed it. Shadowed/hidden fields are legal to have.