aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes help needed in operator precedence/associativity ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "help needed in operator precedence/associativity ?" Watch "help needed in operator precedence/associativity ?" New topic
Author

help needed in operator precedence/associativity ?

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

its been quite some time i did my ocpjp 6 and i have to admit that i never understood operator evaluation, precedence, associativity. the other day i was googling and i found this link on stackoverflow. i read it but was not able to comprehend it fully.i love javaranch and the way people post answers here so i wanted to give another shot at operators and would like to have good discussion on this topic. for that i would like to just have a look at the link here http://stackoverflow.com/questions/6800590/what-are-the-rules-for-evaluation-order-in-java. i do not want you to read it fully , just read eric lipert's answer. i understood few things but still if somebody can explain in more good , understandable, crisp clear way giving examples it would be beneficial for all the ranchers out there
Rameshwar Soni
Ranch Hand

Joined: Feb 03, 2011
Posts: 247
I am not here to explain you eric's answer because i myself haven't understood it properly , its too difficult man, requires around 1 hour to understand. Anyways but way below eric's answer there is Donal Fellows's answer (he too has a good reputation man) where he says eric's answer is not quite helpful in Java. And i think the topic which you are asking is given nicely in books and that too in a bit easier manner.

Anyways someone much better and experienced person than me might help you here.
gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

thanks for the reply Rameshwar. textbooks gives very rudiment idea about all this. that is what was Eric's point. he says that(in the last few lines) that he has edited innumerable textbooks . but i found a link on Eric's blog that has given me somewhat good picture about this. here is the link if you are interested to read http://blogs.msdn.com/b/ericlippert/archive/2008/05/23/precedence-vs-associativity-vs-order.aspx

though he talks about c# but at stackoverflow.com he says that it is valid for java as well.
Praveen Kumar M K
Ranch Hand

Joined: Jul 03, 2011
Posts: 256
Request you to post this in Java General forum. You'll get more hits there.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

First, it may be a good idea to explain what you don't understand -- saying "I don't understand the blog and can you explain it to me in a way I understand" doesn't work. After all, how can we explain something in a different way, and know that it would work?

Second, this topic has come up before -- so SearchFirst.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help needed in operator precedence/associativity ?