aspose file tools*
The moose likes Java in General and the fly likes unary operators Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "unary operators" Watch "unary operators" New topic
Author

unary operators

khella smith
Ranch Hand

Joined: May 06, 2002
Posts: 39
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

Joined: Sep 29, 2000
Posts: 8521
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


"JavaRanch, where the deer and the Certified play" - David O'Meara
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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)?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: unary operators