![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Computer Programming for Engineers and Scientists |
To download the programs, right click on the links and select Save Link As... or Save Target As.... Some of these sample programs have been developed by the UW CS department.
Review of classes: BankAccount.java, BankAccountTest.java
Interfaces: Customer.java, OrdinaryCustomer.java, PreferredCustomer.java
Programming by contract: StringList.java, StringListWithPreAndPost.java
Animal.java, Cat.java, Dog.java
BankAccount.java, RegularAccount.java, CheckingAccount.java, SavingsAccount.java
Car.java, FancyCar.java, TestCar.java
BallSim.zip (Model, View)
MainClass.java, ButtonListener.java, GraphicsWindow.java (event handling, inner classes)
Threads: (powerpoint slides)
A first thread example: ThreadName.java
The same example using the Runnable interface: ThreadNameWithRunnable.java
An example of the uncontrolled concurrent execution of 2 threads: BadConcurrency.java
Using synchronization: TestSenderReceiver.java, Buffer.java, Sender.java, Receiver.java
GeneratingAnException.java, CheckInput.java, UsingExceptions.java, TracingExceptions.java, CatchException.java
DownloadFile.java (copy to your computer any internet file), FileCopy.java (copy a text file), InputOutput.java (a review of I/O, use of System.in)