ICS 22 / CSE 22 Fall 2009
Code Examples


Code examples, from lecture and otherwise

Over the course of the quarter, I'll be providing commented code examples for you. You are not permitted to copy and paste any of this code into your own projects. These examples are mostly to give you clean and well-documented examples of some of the things we cover in lecture (and possibly a few things that we don't, time permitting), so that you can be free in lecture to avoid trying to take detailed notes when we're writing code together, instead concentrating on understanding the process and the bigger-picture concepts at work when we develop the examples.

Lecture Date(s) Description
Tu 9/29 A demonstration of how to define and use enums in Java
Th 10/1 A completed, commented version of the "count lines in files" example from lecture
Tu 10/13
Th 10/15
The Student / FullTimeStudent / PartTimeStudent example of inheritance and polymorphism
Th 10/15 Implementing an equals( ) method
Tu 10/20 Our programming unit testing example from lecture — plus an additional example
Th 11/5 An example of writing unit tests using JUnit