Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Operator - operands

 
Doit
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
can some one please correct me if i am wrong.
- Thanks in advance

Operator Operates on
++ -- on char,byte,short,int,long,float,double
~ on char,byte,short,int,long
! on boolean
* / % on char,byte,short,int,long,float,double
+ - on char,byte,short,int,long,float,double and (+ operates on Strings also)
<< >> >>> on char,byte,short,int,long
< <= > >= on char,byte,short,int,long,float,double
& ^ | on boolean,char,byte,short,int,long
&& | | on Boolean

 
Doit
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please assure me.
 
Doit
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No takers???
 
Doit
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do u think??
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your list looks good. The only error I see is that && and | | operate on boolean, not Boolean. I assume that's what you meant, but case is important in Java. For completeness, you could also add =, ==, and the composite operators (+= etc.)
[This message has been edited by Jim Yingst (edited August 13, 2000).]
 
rajsim
Ranch Hand
Posts: 116
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could add :
unary + and - (operates on numeric primitives)
() (operates on ?expressions? )
[] (operates on array references)
(typecasting) (operates on references and primitives)
. (dot) (operates on references)
instanceof (operates on references)
and also ?: though it is debatable whether it is included in
the objectives. However it appears in many mocks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic