hi friends,
please check out the following code...
class test{
public static void main(String[] args) {
final char c = 5; // 1
byte b2 = c; // 2
System.out.println("b2= "+b2);
}
}
in above code we are converting char to byte. But if we do not write final keyword in line 1 then compiler gives an compile-time error. Why so? what is a role of 'final' keyword in this code?
thank you,
Shubhada