• 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

Operator precedence

 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How much does SCP 1.4 depend on knowing operator precedence? I don't see it listed among the exam objectives, but some of the questions in the K&B Self Test for Chapter 3 rely on, for example, knowing that && has a higher precedence than || and knowing that + is evaluated left to right. Does the real exam also require you to know that?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't remember exactly - I would say the 1.4 exam does not require extensive knowledge of the precedence of all operators. Or if it does, I didn't happen to get those questions when I took the exam. Personally I just remember that * and / are before + and -, which are before any relational operators, which are before && which is before ||. So I can correctly evaluate something like

if (x + 2 * y > 7 || x < 0 && y == 0)

though in real life of course I'd want some parens in there.

That's probably more than you need to know for the exam, but my point is that if the exam had required more than that from me, I'd probably remember that fact now. The exam probably doesn't expect you to know that && is before ||, and may well require less than that - but I couldn't say how much less.

Hope that helps...
[ March 10, 2006: Message edited by: Jim Yingst ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic