Course Hero Logo

No8 given that coursetxt is accessible and contains

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 5 - 7 out of 8 pages.

NO.8Given that course.txt is accessible and contains:Course : : JavaFree Exam/Cram Practice Materials - Best Exam Practice MaterialsGet Latest & Valid 1z0-809 Exam's Question and Answers from Freecram.net.5
and given the code fragment:public static void main (String[ ] args) {int i;char c;try (FileInputStream fis = new FileInputStream ("course.txt");InputStreamReader isr = new InputStreamReader(fis);) {while (isr.ready()) { //line n1isr.skip(2);i = isr.read ();c = (char) i;System.out.print(c);}} catch (Exception e) {e.printStackTrace();}}What is the result?
NO.9Given the code fragments:4. void doStuff() throws ArithmeticException, NumberFormatException, Exception {5. if (Math.random() >-1 throw new Exception ("Try again");6. }and24. try {25. doStuff ( ):26. } catch (ArithmeticException | NumberFormatException | Exception e) {27. System.out.println (e.getMessage()); }28. catch (Exception e) {29. System.out.println (e.getMessage()); }30. }Which modification enables the code to print Try again?

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 8 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture