Hi, so I'm new with Java and the programming thing. Here's my problem. I need to do an errortrap without using a loop and creating a method solely for errortrapping so I figured i need to use try and catch statements but I'm not sure how. Basically my problem is that I need to get a user input to proceed to another method and to exit. Say for example, the program requires you to input 'e' to exit and 'p' to proceed. Anything else would be an error. Can anyone give me an example?
Jump to Post
you've mentioned everything you need to do.
is it necessary you throw an exception, do you just have to show an error message, ...
be a bit more clear, and show what you've tried so far.
All 8 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.