Possible Duplicate:
How to listen to keyboard events in a console application
Hi I am new to java syntax.I am trying to invoke an action on a keystroke like "ENTER key"
For ex:
on pressing Enter key {
int c = 9+8 ; //This should run on pressing enter key but not just running program directly
printf("c");
}
I have referred few java doc relating to this and tried to execute the code.But I face few syntax errors. Can any one give direct example