12.07.2015 Views

5 Getting Input from Keyboard

5 Getting Input from Keyboard

5 Getting Input from Keyboard

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sample Program●The given block defines a try-catch block.try{name = dataIn.readLine();}catch( IOException e ){System.out.println("Error!");}This assures that the possible exceptions that could occur inthe statementname = dataIn.readLine();will be caught.– We will cover more about exception handling in the latter part of thiscourse.Introduction to Programming 1 13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!