Archive for the ‘puzzle’ Category
Can you spot Java Puzzler in this snippet?
Reading time: < 1 minute
I ran across this last week. It was marvelous when we saw what was happening, but entirely puzzling at first.
Boolean someFlag = complicatedLogicToFigureOutFlag(); Person person = new Person(someFlag);
Any signs for concern? How about if Person’s constructor is:
Person(boolean someFlag) { this.someFlag = someFlag; }
Any warning signs?
Will it compile?
Read more for the full puzzler.
