lecture26

lecture26 - CS111: Intro to Computer Science Lecture 26...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 1 Lecture 26 CS111: Intro to Computer CS111: Intro to Computer Science Science Lecture 26 Exceptions
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 2 Lecture 26 Final Exam Final Exam Will NOT include inheritance or exceptions
Background image of page 2
CS111: Slides for Prof. Steinberg ʼ s lecture 3 Lecture 26 Simplified IO. Simplified IO. readInt readInt public static int readInt(){ while (true) { try { String s = kb.readLine(); return Integer.parseInt(s); } catch (NumberFormatException e) { System.out.print("not an int, try again:"); } } }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 4 Lecture 26 Syntax of try/catch Syntax of try/catch try{ <statements> } catch (<kind of exception> <variable>){ <statements> }
Background image of page 4
CS111: Slides for Prof. Steinberg ʼ s lecture 5 Lecture 26 Meaning of try/catch Meaning of try/catch Do statements in the try part Normally skip the catch part If an exception if thrown 1 while doing the try part, Immediately stop try part and do catch part
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS111: Slides for Prof. Steinberg ʼ s lecture 6
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/01/2011 for the course 198 111 at Rutgers.

Page1 / 17

lecture26 - CS111: Intro to Computer Science Lecture 26...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online