Puzzling Java statement of the day

Some days ago I stumbled across a Java statement which I thought was trivial at first, only to discover that I had no idea. I have a reasonable understanding of what a JVM does and how Java bytecode is executed. But as this example shows once again, that doesn’t necessarily spread to the Java programming language. The snippet below should explain my point.

int lorem = 1, ipsum = 2, dolor = 3;
if (lorem == (lorem = ipsum))
if ((ipsum = dolor) == ipsum)

Which of the above two methods f() and g() is actually invoked? Can you tell without compiling the code? Possible answers are:

  • None of the two methods get invoked, both call-sites are dead code.
  • Just f() is invoked and the call-site of g() is dead code.
  • Just g() is invoked and the call-site of f() is dead code.
  • Both methods are invoked, the conditions are pointless.

Ironically, I finally understood what was going on after looking at the generated bytecode (good old javap is your friend). I am not posting the disassembled code because that would spoil the fun. But once you look at it, the answer appears to be quite obvious.

Thank you for every other

Thank you for every other informative blog. The place else
could I am getting that type of info written in such an ideal way?
I have a mission that I'm just now working on, and I have been on the glance out
for such info. http://steffy.ro/forum?func=view&catid=3&id=35025 http://multie.mx/united-s-new-jerseys-number/ http://vipjerseysale.Mihanblog.com/post/14

Hi everyone, it's my first

Hi everyone, it's my first pay a visit at this web page, and
paragraph is really fruitful designed for me, keep up posting such articles.wholesale
nhl jerseyshttps://songexclusive.com/2015/02/20/video-tbt-sports-talk-january-31-2011/https://www.wearabletechnology.london/what-s-happened-in-mlb-on-transport/

What i don't realize is in

What i don't realize is in truth how you are no longer actually a lot more smartly-preferred than you might be now.
You are very intelligent. You already know thus significantly in terms of this
subject, made me in my opinion consider it from so many varied angles.
Its like men and women don't seem to be interested unless it is
something to accomplish with Woman gaga! Your own stuffs
outstanding. All the time care for it up!cheap baseball jerseys from Chinahttp://xn--b1aojbfbabpdgmsl.xn--p1ai/forums/topic/state-of-az-cardinals-search-for-first-football-customer-discipline/http://www.tchoukball.it/forum/viewtopic.php?f=4&t=144390

This is a great post. I like

This is a great post. I like this topic.