Commit 24761a1e authored by Trisha Gee's avatar Trisha Gee
Browse files

[Ch13] Bringing in more examples from the book

parent c9f58e79
Loading
Loading
Loading
Loading
+7 −0
Changes for src/main/java/ch13/Laundry.java: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
package ch13;

public class Laundry {
  public void doLaundry() throws PantsException, LingerieException {
    // code that could throw either exception
  }
}
 No newline at end of file
+4 −0
Changes for src/main/java/ch13/LingerieException.java: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
package ch13;

public class LingerieException extends Exception {
}
+3 −4
Changes for src/main/java/ch13/MusicTest1.java: 3 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -4,17 +4,16 @@ import javax.sound.midi.*;

public class MusicTest1 {
  public void play() {

    try {
      Sequencer sequencer = MidiSystem.getSequencer();
      System.out.println("Successfully got a sequencer");
    } catch(MidiUnavailableException e) {
      System.out.println("Bummer");
    }
  } // close play
  }

  public static void main(String[] args) {
    MusicTest1 mt = new MusicTest1();
    mt.play();
  } // close main
} // close class
 No newline at end of file
  }
}
 No newline at end of file
+4 −0
Changes for src/main/java/ch13/PantsException.java: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
package ch13;

public class PantsException extends Exception {
}
+0 −1
Changes for src/main/java/ch13/TestExceptions.java: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ public class TestExceptions {
    }
    System.out.println("end risky");
  }

}

class ScaryException extends Exception {
Loading