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))
	f();
if ((ipsum = dolor) == ipsum)
	g();

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.

Well, this got me thinking

Well, this got me thinking what other workouts are good for those of us who find ourselves on the road or have limited equipment options.

Excellent blog you have got

Excellent blog you have got here.. It's difficult to find quality writing like yours nowadays.
I seriously appreciate people like you! Take care!!
http://Hidden-Canyon.1103110.N5.Nabble.com/The-Top-10-Sports-Jerseys-Of-... http://www.marbiko.pl/id-3026681065 http://www.veedelplus.de/remember-forever-the-big-game-for-2011-nba-all-...

I'm going to begin following

I'm going to begin following you on Facebook.

Remarkable! Its actually

wonderful issues altogether,

wonderful issues altogether, you simply won a new reader.
What could you recommend in regards to your publish
that you just made a few days in the past? Any certain? http://www.nationalcanine.com/forum/topic/m60-close-up-following-fender-... http://Www.colegiofatima.edu.ni/index.php?option=com_kunena&func=view&ca... http://metal-slug-defense-forums.1126147.N5.nabble.com/usually-requires-...

It's awesome to pay a quick

It's awesome to pay a quick visit this website and reading the views of all friends about this piece
of writing, while I am also zealous of getting familiarity. http://elektroniksigaratutunukibris.jw.lt/index/__xtblog_entry/13956830-...

Marvelous, what a weblog it

Thanks designed for sharing

Thanks designed for sharing such a pleasant thought, piece of writing is fastidious, thats why i have read it fully http://newyorkislandersjerseys.mee.nu/?entry=2694977 http://blazedesk.nl/2010-baseball-all-star-game-fan-review/ http://tollardroyal.com/types-of-basketball-jerseys/

Eclipse spoiled the fun for

Eclipse spoiled the fun for me, since it highlights comparisons between equal expressions (since Galileo I believe), and yes, the Eclipse code analyser gets this right. My first guess when reading the post was right, but I wouldn't have put money on it.

Here's the relevant JLS section: http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#1...

As the admin of this site is

As the admin of this site is working, no doubt
very quickly it will be famous, due to its quality
contents. https://geekbench.pw/

This is very interesting, You

This is very interesting, You are an overly professional blogger.

I've joined your feed and look forward to looking for extra of your fantastic post.

Also, I have shared your site in my social networks https://drive.google.com/file/d/1NVBYp0U3wLMC6OaClx-xepDpovSF5EOk/view?u... https://drive.google.com/file/d/17gejt5c2F9A7pU3yd_TSN7bcuCVoc6jz/view?u... https://drive.google.com/file/d/14M2u-aHM-s60z3avec1TZMor6tYNFzp6/view?u...

I do not even know how I

I do not even know how I ended up right here, but I assumed this submit
was once great. I do not understand who you might be but definitely
you're going to a famous blogger when you aren't already.

Cheers! https://www.koreanbbqshop.com/custom-design-team-uniforms-for-an-look/ http://maximum-mini-forum.2322815.n4.nabble.com/mirielle-Dicksusing-s-am... http://Notre-Dame-Girls-School.79155.X6.Nabble.com/Kokomo-partner-trying...

Excellent way of telling, and

Excellent way of telling, and pleasant paragraph to take information concerning my presentation subject matter, which i am going to present in college.

http://blue-knights-colorado-1.40445.n7.nabble.com/Meth-driven-crisp-inc... https://www.brightensomeonesday.net/MAP/event/30160 http://left-bank-manc.2340364.n4.nabble.com/move-on-ski-transfer-pads-th...

An outstanding share! I've

An outstanding share! I've just forwarded this onto a coworker who was doing a little homework on this.
And he actually ordered me breakfast simply because I
discovered it for him... lol. So allow me to reword this....
Thanks for the meal!! But yeah, thanx for spending
some time to talk about this matter here on your web page.
http://aandetoys.com/2016/05/4u3ob43bsb17.html http://www.ddcarton.com/buying-an-additional-soccer-jerseys-as-a-variety... https://cobe.vn/types-of-basketball-jerseys.html

Hello, its pleasant paragraph

Do you have any video of

Do you have any video of that? I'd want to
find out some additional information.wholesale football jerseyshttp://premium.premium27.ru/index.php/kunena/razdel-predlozhenij/106-excited-tabbies-keep-tight-duty-on-up-against-parthttp://www.nadpiramida.ru/forum/viewtopic.php?f=1&t=42389

I was recommended this web

I was recommended this web site via my cousin. I am now not certain whether or
not this publish is written by means of him as no one
else understand such targeted approximately my problem.
You are incredible! Thanks! http://www.planetadamusica.com/indicacao/revealing-vital-elements-of-che... http://neworleanspelicansjerseys.spruz.com/pt/2-million-rifle-scale-crea... http://Utim.fr/blog/popularity-of-soccer-jerseys/

I pay a quick visit each day

I pay a quick visit each day a few web pages and blogs
to read content, but this blog gives quality based posts.
http://Forum.gsuhvz.com/viewtopic.php?f=13&t=68557 http://tangotiger.de/forum/viewtopic.php?f=21&t=37404 http://sunnet.vn/how-to-source-wholesale-soccer-uniforms-3/

What's up to all, it's truly

It's going to be end of mine

It's going to be end of mine day, however before ending I am reading this wonderful post to increase my experience.authentic football jerseyshttp://michaeltoy.webcrow.jp/viewthread.php?tid=951570&extra=page%3D1&frombbs=1http://rekar.biz/edmontonforum/viewtopic.php?f=19&t=83145

I used to be suggested this

I used to be suggested this web site by means of my cousin.
I'm now not positive whether this submit is written by him as nobody else recognize such specific approximately my problem.
You are wonderful! Thank you! http://www.16leaves.com/top-five-most-terrible-nfl-jerseys/ https://wna.ch/puppy-coaching-teaching-cheap-nfl-jerseys-your-dog-to-acc... http://quin.space/uncategorized/rss-feeds-feed-your-world-wide-web-rrnte...

If you want to obtain much

My brother suggested I may

My brother suggested I may like this web site.
He was totally right. This post truly made my day.
You can not imagine simply how so much time I had
spent for this information! Thanks! http://jerseysanaheimducks.spruz.com/pt/-heroAshtone-Morgan-scored-that-... http://www.todogeologia.com/viewtopic.php?f=2&t=70248 http://Deensidewheelers.com/component/kunena/4-adverts/298381-the-first-...

Quite interesting article,

Quite interesting article, how is your script can help me with the integration payment system in the website with music events http://bandstours.com ? But big thanks for your work! What if I can answer you on this?

Good web site you have here..

Good web site you have here.. It's hard to find
high quality writing like yours nowadays. I honestly appreciate people like you!
Take care!!690090https://www.retrogamersclub.com/forums/topic/tonyan-getting-enhancement-in-search-of-football-aspiration/https://rescuetraining.de/index.php?title=Benutzer_Diskussion:Baidai8300https://www.retrogamersclub.com/forums/topic/tony-romo-playing-pga-concert-tours-race-in-dominican-rebublic-republic/

It's difficult to find

It's difficult to find educated people about this subject,
but you sound like you know what you're talking about!
Thanksauthentic football jerseys Chinahttp://local-723-members.88536.x6.nabble.com/Lyft-voyages-paying-region-td141.htmlhttp://joinbuy.mee.nu/?entry=2793141

Hi there, this weekend is

Hi there, this weekend is good for me, because this occasion i am reading this enormous
informative post here at my house. http://kingdomjersey.mee.nu/?entry=2798670 http://Gayonnet.com/forum/topic/521 http://being-in-the-world.91626.n3.nabble.com/united-kingdom-internation...

Hello, i believe that i

Hello, i believe that i noticed you visited my web site thus i got here to
go back the want?.I am attempting to to find issues to improve my website!I assume its ok to make use of
a few of your ideas!!post-39464http://www.aapaurary.com/forum/AAP_AUR_ARY_postsm5830_Carolina-Panthers-2017.aspxhttp://baidai8300.unblog.fr/2018/08/23/chronicle-the-actual-buffalo-grass-billing-accounts-cycling-cycling-tops/

As the admin of this web page

As the admin of this web page is working, no doubt very
shortly it will be renowned, due to its feature contents.2100http://ridgedroofing.com/index.php?option=com_kunena&view=topic&catid=2&id=135960&Itemid=818http://whotheweio.mee.nu/?entry=2804724

magnificent points

magnificent points altogether, you just received a new reader.
What might you recommend about your put up that you made a few
days ago? Any positive? http://table-rock-lake-party.56548.x6.nabble.com/easy-community-centre-r... http://PistDorSt.mihanblog.com/post/99 http://zambezionline.com/forum/index.php?page=topicview&id=website-comme...

Definitely believe that that

Definitely believe that that you stated. Your favourite justification appeared to be at the net the easiest factor to be aware of.
I say to you, I definitely get irked while other folks
think about concerns that they just don't understand about.
You controlled to hit the nail upon the highest and also outlined
out the entire thing with no need side-effects , folks could
take a signal. Will probably be back to get more. Thanks http://www.forumlogopedyczne.pl/viewtopic.php?f=16&t=186591 http://maximum-mini-forum.2322815.n4.nabble.com/nfl-in-the-media-td558.html http://the-teacher-forum.86415.x6.nabble.com/Socceroos-inform-Bert-van-M...

com which is giving a FREE e

com which is giving a FREE e - Book to helpp get you started with your own survival
garden. Such featurfes aree all benefits of using laptop bags.
You buy one bag but actually with two different shapes.

I'm no longer certain where

I'm no longer certain where you are getting your info, but good topic.
I must spend some time finding out more or figuring out more.
Thank you for fantastic info I was on the lookout
for this info for my mission. http://www.konsciouscreations.com/201702/b04v2duxhy12 http://99jerseys.mee.nu/cheap_jerseysauthentic_pittsburgh_steelers_jerse... http://crazytennisbitches.com/guide-to-sports-activities-jerseys-cheap/

Wonderful goods from you,

Wonderful goods from you, man. I've take into accout your stuff previous to and you are
just too magnificent. I actually like what
you have bought right here, really like what you are stating and the best way in which you say it.
You're making it entertaining and you continue to take care of to keep
it sensible. I can not wait to read much more from you.
That is actually a wonderful web site.

Pingback

[...] Puzzling Java statement of the day | antforge.org antforge.org/blog/2010/07/30/puzzling-java-statement – view page – cached 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. Tweets about this link [...]

I love what you guys are

I love what you guys are usually up too. This kind of clever work and exposure!
Keep up the terrific works guys I've incorporated you guys to blogroll.cheap jerseys from Chinahttp://rojangba.com/viewtopic.php?f=16&t=79609http://eko.chrzanow.pl/forum/viewtopic.php?f=2&t=9073

Howdy very nice web site!!

Howdy very nice web site!! Man .. Beautiful ..

Superb .. I will bookmark your website and take
the feeds also? I'm happy to find a lot of helpful info right here in the post, we'd
like work out extra techniques in this regard,
thanks for sharing. . . . . . https://drive.google.com/file/d/17eB5IfEHaa_bx79eGIgH0TbTjF9Vx32a/view?u... https://drive.google.com/file/d/1PQxxJPr0e0nNmhMbr0D0JGFiCCWf9Tpg/view?u... https://drive.google.com/file/d/1O0G8K2jltdBc5imTZi_ZoW-EP4BMX9-w/view?u...

This page definitely has all

This page definitely has all the information and facts I wanted concerning this subject and didn't
know who to ask. wholesale nhl jerseys Chinahttp://newlook-decorative-concrete-forum.2323233.n4.nabble.com/Antoinette-Tuff-positions-her-life-at-stake-to-finish-georgi-td4688.htmlhttp://test02.heliforum.ch/forum/willkommen/56-astros-distressed-red-color-sox-to-spread-out-weekend-break.html

I think you need help from

I think you need help from this guys http://ezcollegepapers.com , they can help you to beat your papers in college!

If you would like to obtain a

If you would like to obtain a good deal from this post then you
have to apply these techniques to your won web site.
http://www.chrlice.brno.cz/forum/viewtopic.php?f=8&t=57627 http://authentic-cheap-jerseys.mee.nu/?entry=2767440 http://minnesotawildjerseys.mee.nu/?entry=2766448

My brother recommended I

My brother recommended I might like this blog.
He was once entirely right. This put up actually made my
day. You cann't imagine just how a lot time I had spent for this info!
Thanks! http://johanna-maria.82413.x6.nabble.com/Democratic-senators-in-cheap-im... http://premium.Premium27.ru/index.php/kunena/dobro-pozhalovat/46-moose-c... http://lierseontour.bbforum.be/post4862.html

I like reading through a post

Nice post. I used to be

Nice post. I used to be checking constantly this weblog and I am impressed!
Extremely useful info particularly the remaining phase :) I handle such info a lot.
I used to be seeking this certain info for a long time.
Thanks and best of luck. http://traktorbetten.de/2597-2/ http://atlantabravesjerseys.Mee.nu/?entry=2770843 http://www.coolkidsbedding.com/482-2/

It's always cool to see ideas

It's always cool to see ideas people come up with
for kids.