Delay initialization of Final Variable are Possible only within Constructor
Yeah we are going to practically prove another statement of final keyword called Delay initialization of final variable are possible only within constructor.
We are going to write total 3 programs to prove it.
Program 1: -
class fin4
{
final int a=10;
void show()
{
System.out.println(a);
}
static public void main(String[] args)
{
new fin4().show();
}
}
If you compile this program, you will get output of 10 [...]