• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help needed in operator precedence/associativity ?

 
gurpeet singh
Ranch Hand
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 924
1
Fedora Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Request you to post this in Java General forum. You'll get more hits there.
 
Henry Wong
author
Marshal
Pie
Posts: 21016
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic