Hello Amit,
What I think in this case is you need to intialize the final variable b in the declaration line itself.
You need to intialize the final variable where you have declared it.
1 final int a=1;
2 final int b;
3 b=2;
4 int x=0;
5 switch(x)
6 {
7 case a: //This line compiles fine.
8 case b: // This line gives a compiler error.