Question about Exception handling
so I'm trying to write a complete OOP in Java(yay...well not quite). So, here is the problem. I am trying to pick up good habits and think of exceptional events as I code, so I wrote the following and I'm trying to catch a couple of events. The problem is that I'm getting an error asking for an identifier and I have a simple question. Are they listed somewhere or do I make them up? Please see code below:
and I'm getting the following error:
Scanner userSelection = new Scanner(System.in);
int userselection = userSelection.nextInt();
System.out.print("You did not enter a integer.")
System.out.println("There is nothing to read.");
System.out.println("This method has been invoked at the wrong time. Please try again when prompted.");
So my questions:
----jGRASP exec: javac -g Numbers.java
Numbers.java:29: error: <identifier> expected
Numbers.java:33: error: <identifier> expected
Numbers.java:37: error: <identifier> expected
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
Do I make up a letter or name?...well actually, I doubt it, because I just tried and received a "Cannot find Symbol" error.
Do I look them up somewhere? If so where? I went to the nextInt API and it can throw three exceptions, so I tried to catch them but no luck. Any direction would be appreciated.