Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSean M
7,344 PointsJava: Design the UI
I was wondering if somebody could clarify what the catch (IOException) section.
Thank you.
1 Answer
Trent Christofferson
18,846 PointsIn your promptAction method you ask for user input and in Java anything IO throws an exception, I believe. In the javadocs it says the readLine method can throw an exception "If an I/O error occurs". For more info on why it may throw an exception look at this stackoverflow post: https://stackoverflow.com/questions/2629649/java-what-are-ioexceptions-in-bufferedreaders-readline-for
Sean M
7,344 PointsSean M
7,344 PointsForgot to say thanks for this!
It makes sense now.