Yes and subsequently the object will become lost.
Alexander Caleb wrote:after the if/else statements, won't another Cardinal object with c2 reference variable be created?
The first (and only since the code takes either the if or the else) c2 lives within the confines of the if/else. Outside the if/else I would think that the first c2 is out of scope. The subsequent declaration, in this case, would not be a duplicate. Is this consistent with any provided explanation?
Alexander Caleb wrote:Why does this compile because isn't this a case of a duplicate variable?
Bert Bates wrote:In general we think that formats like epub currently make it virtually impossible to do a good job creating technical training material.
Elisabeth Robson wrote:The errata will be posted on the McGrawhill site on the book page:
Nothing there right now...
Roel De Nijs wrote:So my first advice would definitely be: get rid of your IDE, only use your favourite text editor, javac and java. Other opinions about using an IDE while preparing for the OCA exam can be found here.
Ioannis Gkinalas wrote:
Shadowing fields can make your code difficult to read