This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ++ needs an explicit cast Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "++ needs an explicit cast" Watch "++ needs an explicit cast" New topic
Author

++ needs an explicit cast

manal
Ranch Hand

Joined: Aug 17, 2000
Posts: 45
byte b = ++7; is valid
BUT
byte b1 = 7;
byte b2 = ++b1; needs an explicit case
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
No, I think ++ and -- works fine for byte type, and I tried it, it's OK.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ++ needs an explicit cast
 
Similar Threads
mock exam Q compile time constants
uranary + operator
Byte class
b*=b1 vs b=b*b1
+= and ++