Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RR #13

Steven YaegerII
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am improving slowly, though when I code some of these roundups, I feel like I'm regressing...
As Rules Roundup answer #13 says that byte c = (byte) a + b; is a valid line, and because it seems to me like it should work, I cannot understand why it doesn't work in the code below. What could I be doing that is most likely so obvious that it would bite me? (none of my variations work either, though it works in System.out.println( a + b ).

How come the last line doesn't make var c equal a (byte) 5?
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic