• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

how to evaluate the following expressions?

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)


what is the output of the above program 1). how is the expression (x += EASY + ++x), evaluated?

also, hows the expression evaluated in program 2) as below, here which operator has more precedence in if(b1 & b2 | b3), & or |.

2)


iam generally very weak in operator precedence. other than the fact that, *,/,% has more priority than +/- other things are very confusing for me.
what about the priority of, +=, *=, /= , do they have more priority than all the other operators?
 
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
your first question has been discussed earlier look Here
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The questions in the SCJP exam don't confuse you too much about operator precedence. There are only basic operator precedence questions so don't worry too much. The full list of operator precedence can be found here...
 
Getting married means "We're in love, so let's tell the police!" - and invite this tiny ad to the wedding:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic