CS 2852
Samples
Chapter 1
Samples showing interfaces and abstract classes:
IdentifiedObject.java
ToDoList.java
ShoppingList.java
ConstructionSteps.java
Chapter 2
Sample code using array lists to count the frequency of the last word of input (assuming no punctuation, words separated by whitespace):
broken solution
, corrected
LastWordFrequency.java
A
sample word list
is also available.
SimpleArrayList.java
: simplified version of ArrayList. A
driver
is also available.
SimpleLinkedList.java
: singly-linked lists
LineCounter.java
: prompt user for file and count the non-empty lines. This illustrates using the file chooser dialog and reading data.
Chapter 5
Value.java
: binary search