Well, int is 4 bytes and char is 2 bytes
long. But even then ur explanation should have been correct. But i tried
to change the code as
input = System.in.read();
choice = (char) input;
But the problem remained. However the explanation given by Pallav (See
below) was found to be correct. When i gave the input 9<space>1<enter>it
first redisplayed the menu twice but the second time automatically went
to the switch case associated with choice 1.
I guess it stores the input we enter in a buffer and takes its input
from there. So the next question is how do i correct this? That is after
it takes the first input, how do i flush the buffer???