This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
Since you are using final constants and adding them up and assigning them to a byte variable, the checking is performed at compile time itself since they are constant evaluations. And since the addition operation goes out of range you get a compiler error.
Joined: Aug 16, 2006
thanks for reply, chetan
you mean that if i add variables (which are not final) then the addition is performed at runtime otherwise at compile time.