Lecture Notes – January  20th

 

We talked about Quiz 1 and why one answer was better than another – review the comments about it.

 

We reviewed the things that came up during Lab 2

 

We completed the lecture notes from January 18th by looking at the following files in detail.

            ReadFromFile1.java

            ReadFromFile1a.java

            ReadFromFile1b.java

            ReadFromFile1c.java

            ReadFromFile1d.java

            ReadFromFileOutputMessages.doc

            ReadFromKeyboard_1.java

            ReadFromKeyboard_1a.java

          ReadFromKeyboardOutputMessages.doc

 

We talked briefly about the finally block

finally

{

   // used in conjunction with try block

   // includes what to do

   //either after exception is caught OR

  //  if it’s not caught

}

 

We looked at 

          Propagation.java (listing 10.3, page 539)  and

ExceptionScope.java  (listing 10.4, page 540)

And we saw how to create a particular Exception object and use it to call the methods

          getMessage();

          printStackTrace();

 

We saw that you can create your own exceptions

          Study the modified  OutOfRangeException.java (listing 10.6 on page 544)

 

We saw that you can explicitly throw an exception

            Study the modified CreatingExceptions.java (listing 10.5 on page 543)