• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Operator - operands

 
Ranch Hand
Posts: 169
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please assure me.
 
Doit
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No takers???
 
Doit
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do u think??
 
Wanderer
Posts: 18671
  • 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).]
 
Ranch Hand
Posts: 116
  • 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 guess everyone has an angle. Fine, what do you want? Just know that you cannot have this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic