aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Operator precedence Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Operator precedence" Watch "Operator precedence" New topic
Author

Operator precedence

Greg Charles
Bartender

Joined: Oct 01, 2001
Posts: 2542
    
  10

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?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
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 ]

"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Operator precedence
 
Similar Threads
short circuit operators precedence
Operator Precedence
Logical operator precedence
Logical operators (&& and ||)
&& and || operator precedence