review3.2010

review3.2010 - Review Q1. Exceptions identify errors that...

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

View Full Document Right Arrow Icon
Review Q1. Exceptions identify errors that arise in your program. Name the two categories of exceptions that are derived directly from Throwable and differentiate between them. Q2 True or false. The classes InputStream and OutputStream are used to read and write byte data. Q3. The class StreamTokenizer is used to read byte date. True or false? Q.4 The classes Reader and Writer are used to read and write character data. True or false? Q5 Write down the output as it would appear on the screen. class Exceptions { public static void main(String[] args) { int x[] = {2, 4, 6}; method(0, x); method(x[2], x); method(2, x); } static void method(int i, int arr[]) { String str = "Yes its true"; try { System.out.println("Programming II"); System.out.println("This first value is " + arr[i]); System.out.println("This second value is " + arr[i]/(arr[i] - 6)); System.out.println("This line will be printed"); } catch(ArithmeticException e) { System.out.println("ArithemticException caught"); 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
} catch(ArrayIndexOutOfBoundsException e)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

review3.2010 - Review Q1. Exceptions identify errors that...

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

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