Hi, Vinod -
well rajeev , that is true in C or C++ but not allowed in Java. Try and see it !
Not true! From Visual C++ Help:
The type of switch expression and case constant-expression must be integral. The value of each case constant-expression must be unique within the statement body.
If you have a compiler that's letting you have a non-integer switch argument, it's most likely one to avoid. Because the switch only tests for equality, it wouldn't even make sense to have a float-type argument.
Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4 all those years ago...)