• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Confused Help

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Every1...
I started preparing 4 the SCJP certification and bought Khalid Mughal book second edition.

As I was going thru the operator precedence chapter, i found something that confused me.

If any1 read the book, it is mentioned in section 3.9 (Relational Operators) on page 107 that relational operators are non associative.

After 1 example, the next line says that relational operators are left associative. Isn't it a conflicting statement ? Or did i get it wrong ?

Cud any1 explain what's the difference ?

Thanx
[ July 12, 2005: Message edited by: Barry Gaunt ]
 
Ranch Hand
Posts: 657
Spring VI Editor Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the Java� Language Specification:

�15.20 Relational Operators
The relational operators are syntactically left-associative (they group left-to-right), but this fact is not useful; for example, a<b<c parses as (a<b)<c, which is always a compile-time error, because the type of a<b is always boolean and < is not an operator on boolean values.

Hope this helps!

P.S. Please make the extra effort to write out words such as "anyone" and "could". The extra keystrokes won't cost much in the way of time, and the enhanced clarity will be appreciated by those communicating on a forum with international readership.
 
reply
    Bookmark Topic Watch Topic
  • New Topic