File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Operator - operands Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Operator - operands" Watch "Operator - operands" New topic
Author

Operator - operands

Doit
Ranch Hand

Joined: Aug 03, 2000
Posts: 169
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

Joined: Aug 03, 2000
Posts: 169
Please assure me.
Doit
Ranch Hand

Joined: Aug 03, 2000
Posts: 169
No takers???
Doit
Ranch Hand

Joined: Aug 03, 2000
Posts: 169
What do u think??
Jim Yingst
Wanderer
Sheriff

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


"I'm not back." - Bill Harding, Twister
rajsim
Ranch Hand

Joined: May 31, 2000
Posts: 116
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
 
subject: Operator - operands