File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "help needed in operator precedence/associativity ?" Watch "help needed in operator precedence/associativity ?" New topic

help needed in operator precedence/associativity ?

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924

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 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

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

though he talks about c# but at 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

Joined: Sep 28, 2004
Posts: 20380

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.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
I agree. Here's the link:
subject: help needed in operator precedence/associativity ?
It's not a secret anymore!