Java Java Data Structures Efficiency! Design the UI

Sean M
MOD
Sean M
Treehouse Moderator 5,225 Points

Java: Design the UI

I was wondering if somebody could clarify what the catch (IOException) section.

Thank you.

1 Answer

Trent Christofferson
Trent Christofferson
13,123 Points

In 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