Interesting though, but
java Bible says that final variable may be assigned to a wider variable. If you delete the final and compile, you will get an error.
Albert
Originally posted by prash fresh:
when i ran the following program, I got the output as 100.My question is: how did the int value of "i" get typecasted to byte??
class Nq
{
public static void main(String args[])
{
final int i=100;
byte b=i;
System.out.println(b);
}
}