• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unary operators

 
khella smith
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do the unary operators operate on single values or double values?
e.g
+2 isn't this an unary operator? and as i can see it is operating on a single value
because i know that it includes ++ -- + = etc according to complete java2 certification guide
i took one mock exam which i forgot the name and it said that unary operators operate on a double value
please clarify it for me
thanks
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kelest,
Please change your name to be compliant with JavaRanch's naming policy.
Your displayed name should be 2 separate names with more than 1 letter each. We really would prefer that you use your REAL name.
Thanks,
Cindy
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by kelest:
it said that unary operators operate on a double value
please clarify it for me

Perhaps it meant the *datatype* double (as in +2.45)?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic