• 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

order of operators

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Will the expression
! ( j * I = = x + y && I > 0)
Compile without error? List the operators in this expression in precedence order, from highest to lowest. List the operators in the order in which they will be evaluated.


can you help me to check my solution

the exception will rise because there is no variable to assign , the order from high to low is

!
*
+
>
==
&&

the order when evaluate is

*
+
==
>
&&
!

Please help me my solution is right ???
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, the question doesn't ask about exceptions, which happen when a program runs; it asks whether the code will compile or not (of course, you can trivially check this yourself: it won't, as written, but if you remove the space between the two equals signs, it does.)

As far as "there is no variable to assign", I don't know what you mean by that, but it doesn't enter into the answer.
 
reply
    Bookmark Topic Watch Topic
  • New Topic