• 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 memorized?

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
Do operator precedence table must be memorized fully?
I find it somewhat confusing...
Do anybody has an easier way to memorize it?
Thanx in advance
Alexan
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you'll need to know a fair portion of that. This has been discussed a few times before. Here is a link which provides a mnemonic.
operator precedence
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alexan -
This is a tricky one. I won't say that you won't get *any* questions to do with precedence, but you won't get very many, and they probably won't be very hard.
If you have everything else absolutely down cold, and you're just dying to find something to memorize, then go ahead.
If however, you're like most people, I suspect your study time will be much better spent on:
- threads
- inner classes
- garbage collection
These 3 topics get hit hard, and they seem to be the trickiest.
In terms of precedence, the attitude of the test creaters was 'good coders should use parentheses'. Now I know there's a lot of squirrely looking code on the mock exams and on the real exam too, but in this one instance, the exam creaters were trying to be realistic.
So, in summary, make precedence a lower priority on your study list.
Good luck
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I saw this really good mock exam question on operator precedence which I found summarised most of the concepts that you need to know.
i=3; j=0; result = 1;
result += i-- * --j;
what is the value of result ?
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do U like this for remembering operator precedence:
U---------unary
All-------arithmetic
R---------relational
Like------logical
Computer--conditional
Addicts---assignment
[ July 02, 2003: Message edited by: La Vish ]
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx La Vish
I was really trying to find an easy way to remember this..
Regards
Vikram
 
Brian Joseph
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
La Vish, I like that better than "Ulcer Addicts"... hehe.
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vicky,
Welcome to Javaranch, a friendly place for Java greenhorns
We ain't got many rules 'round these parts, but we do got one. Please change your displayed name to comply with the JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic