hi again, wat does it mean when u have final int i = 10; byte k = i; u compile this and u get no error but when u take out the final modifier u get an error. does it have something to do with the final being regarded as a constant or what some explanations would be highly regarded thanxs
Yes, when the variable is final it is treated as a constant that the jvm knows will fit into a byte. As soon as you remove the final attribute, then the variable is at risk of being something that will NOT fit into a byte, and you get an error.
"JavaRanch, where the deer and the Certified play" - David O'Meara
Joined: May 06, 2002
thanxs cidy now i can answer a question with more confidence