|
This page documents what we do in class. It contains Java programs that we will discuss in class, simple homework exercises that you can work on for practice and exam preparation (not for credit), and reading assignments from our textbook.
The reading assignments and practice problems are listed by the date on which they were assigned. The sample program files are listed by the date on which they were used. You can click on either a .java link and see the source code, or click on a .html link (when available) and see an applet running. When you are viewing the source code, you can use your browser's "File -> Save As..." menu item to save a copy of the file on your computer. It is a good idea for you to "play" with these example programs; compile them, run them, make simple changes to them and compile and run them again.
For each chapter of the textbook, it is a good idea for you to also look at the Powerpoint slides that the book's author has prepared. You should download them onto your own computer.
|
- NOTE:
- The exam, which is Thursday at 6:00 p.m., is supposed to be in G011, the room that we meet in on Tuesdays.
- Thursday, December 7.
- The following programs extend the client/server example from Chapter 16 of the textbook. The program Server3 is a multithreaded version of the server that can handle multiple simultaneous clients.
- Some more example of threads (see the beginning of Chapter 13).
- Here is a better version of a program that we used earlier in the semester to watch how events are generated by different components in a Swing GUI.
- Here is a link to a nice animated movie about how the Internet works (made as a kind of Star Wars parody). Unfortunately, the movie is huge, so don't try to download it at home. You could download it on campus and then move it to a Zip disk.
- Do you really like to program? And do you have a lot of time on your hands? Here is a zip file containing about 40 internet shorcuts to interesting programming web sites that I found over the last semester.
- Tuesday, December 5.
- Here are two references on the Internet for a particular security problem with MS Internet Explorer and Java. The first reference is to where I first read about this security problem and the second reference is to the person who discovered the problem. The third link is to the Java program that exploits the security problem. The Java program is an applet that makes use of streams.
- Some examples for Chapter 16 that are not in the textbook.
- Example from Chapter 16 of the textbook.
- Read Chapter 13, pages 562-573 and 578-586.
- Thursday, November 30.
- Tuesday, November 28.
- Examples from Chapter 15 of the textbook.
- Tuesday, November 20.
- Some examples for Chapter 11 that are not in the textbook.
- Read Chapter 15, pages 622-643 and 654-663.
- Do Chapter Review problems 15.2, 15.4, 15.6, 15.8, 15.14, 15.15.
- Thursday, November 16.
- Some examples for Chapter 10 that are not in the textbook.
- Examples from Chapter 10 of the textbook.
- Read Chapter 11, pages 492-501 and 508-509.
- Do Chapter Review problems 11.4, 11.8, 11.11, 11.12, 11.13, 11.15, 11.16, 11.17.
- Tuesday, November 14.
- Some interesting applets on the Internet.
- Some examples for Chapter 10 that are not in the textbook.
- Examples from Chapter 10 of the textbook.
- Thursday, November 9.
- Examples from Chapter 9 of the textbook.
- Read Chapter 10, pages 426-432, pages 435-437, and pages 449-467.
- Tuesday, November 7.
- Examples from Chapter 9 of the textbook.
- Thursday, November 2.
- Some examples for Chapter 8 that are not in the textbook.
- Examples from Chapter 8 of the textbook.
- Read Chapter 9, pages 352-394. (Note: A lot of what is in these pages is reference material about various components. However, what is most important in this chapter are the example programs that use these compoents. These are nice examples of simple programs with GUI's. It is more important to understand these examples then it is to remember all the details about the various components.)
- Do Chapter Review problems 9.1, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8.
- Tuesday, October 31.
- Some examples for Chapter 8 that are not in the textbook.
- Examples from Chapter 8 of the textbook.
- Thursday, October 26.
- Some examples for Chapter 8 that are not in the textbook.
- Examples from Chapter 8 of the textbook.
- Read Chapter 8, pages 314-337.
- Do Chapter Review problems 8.16, 8.18, 8.20, 8.21.
- Tuesday, October 24.
- Some examples for Chapter 8 that are not in the textbook. These examples are meant to form a bridge from the book's simple example MyFrame.java to the book's much more complicated example MyFrameWithExitHandling.java.
- Read Chapter 8, pages 306-314.
- Do Chapter Review problems 8.9, 8.11, 8.13, 8.14, 8.15, 8.19.
- Thursday, October 19.
- Examples from Chapter 8 of the textbook.
- Read Chapter 8, pages 284-301.
- Do Chapter Review problems 8.4, 8.5, 8.6, 8.8, 8.9.
- Thursday, October 12.
- Don't forget about the practice exam for the in-class exam on Tuesday, October 17.
- The next five groups of files give an extended example of how implementation can be separated from the public interface of a class. (There are a lot of files here. If you wish, you can download them all as a zip file).
- The next two files give two different implementations of a Hat class. Both of the implementations provide the exact same public interface. The third file uses the Hat class, and it can use either implementation since the two implementations have the same public interface.
- The next file defines an abstract Hat class and the two files after it give two different implementations of the abstract Hat class. The UseHat program shows how the two implementations of the Hat class can be used at the same time.
- The following six files give an example of using both inheritance for specialization and inheritance for implementation. The AbstractHatItem and AbstractGloveItem classes extend the OrderItem class and they provide two different kinds of items that can be ordered. The HatItemA and HatItemB classes provide two different implementations of the AbstractHatItem class, and the GloveItem class provides an implementation of the AbstractGloveItem class.
- The following example redoes the last example but it uses interfaces to define the public interface of a hat and a glove item (instead of abstract classes). So now the HatItemA and HatItemB classes both extend OrderItem and they both implement the HatInterface. And the GloveItem class extends OrderItem and implements the GloveInterface.
- The following example redoes the last example to show that classes can implement multiple interfaces (but classes can only inherit from one parent class). In this example we add a Returnable interface that an OrderItem can implement and we make the GloveItem class implement this interface. So now the HatItemA and HatItemB classes both extend OrderItem and they both implement the HatInterface. And the GloveItem class extends OrderItem and implements both the Returnable interface and GloveInterface. (Only the files that need to be changed for the last example are given below.)
- Tuesday, October 10.
- First of all, here is a practice exam for the in-class exam next Tuesday, October 17. (This practice exam is a bit longer than what the in-class exam will be.)
- Some examples for Chapter 7 that are not in the textbook.
- From Chapter 7
- Thursday, October 5.
- From Chapter 7
- Read Chapter 7, pages 247-257 and 265-274.
- Do Chapter Review problems 7.7, 7.8, 7.10, 7.12, 7.13, 7.14, 7.15.
- Tuesday, October 3.
- Some more examples for Chapter 6 that are not in the textbook.
- From Chapter 6
- Read Chapter 7, pages 236-247 (up to polymorphism).
- Do Chapter Review problems 7.1, 7.2, 7.3, 7.4, 7.5, 7.6.
- Thursday, September 28.
- Some more examples for Chapter 6 that are not in the textbook.
- From Chapter 6
- Tuesday, September 26.
- Some examples for Chapter 6 that are not in the textbook.
- From Chapter 6
- Read Chapter 6, pages 209-219 (the String part of the chapter).
- Do Chapter Review problems 6.12, 6.13, 6.14.
- Thursday, September 21.
- Some more examples for Chapter 5 that are not in the textbook.
- Read Chapter 6, pages 190-209 (the array part of the chapter).
- Do Chapter Review problems 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.8, 6.9, 6.10, 6.11.
- Tuesday, September 19.
- Some examples for Chapter 5 that are not in the textbook.
- Thursday, September 14.
- Some examples for Chapter 5 that are not in the textbook.
- From Chapter 5
- Tuesday, September 12.
- Some examples for Chapter 5 that are not in the textbook.
- From Chapter 5
- Read Chapter 5, pages 162-181.
- Do Chapter Review problems 5.3, 5.5, 5.6, 5.8.
- Thursday, September 7.
- From Chapter 4
- Read Chapter 5, pages 147-161.
- Do Chapter Review problems 5.1, 5.2, 5.4.
- Tuesday, September 5.
- Thursday, August 31.
- From Chapter 3
- Read Chapter 4.
- Do Chapter Review problems 4.1, 4.3, 4.4, 4.5, 4.6, 4.9, 4.10.
- Tuesday, August 29.
- From Chapter 2
- Read Chapter 3.
- Do Chapter Review problems 3.1, 3.2, 3.9, 3.10, 3.11, 3.12, 3.14, 3.15, 3.17, 3.18, 3.19.
- Thursday, August 24.
- From Chapter 1
- Read Chapters 1 and 2.
- Do Chapter Review problems 2.3, 2.7, 2.8, 2.9, 2.10, 2.13, 2.14, 2.16, 2.18, 2.19.
|
|
|
|