This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Yes you are right this is due to final keyword only. Beacuse if a variable is declared as final it is compile time constant and the value will be known to the compiler that it is within the range.Try the same program with
final int i=1000; then you will be getting Compile time error.