posted 18 years ago
HI. In the first , final int l=120; and short x=l; complies fine
beacuse , complier consider that , you are directly assiging 120 value
to the x variable which is a short.
In the Second, int l=120;short x=l;which gives complie time error.
because, you are directly assinging the big value(int type) in the
smaller value(short type),which gives compile time error.
here, final modifier works differently.
Thanks & Regards,
ChandraSekharMangipudi