Course Handouts
ex1.java Simple example showing basic Java program structure
ex2.java Java variables, assignment and simple types
ex3.java Java expressions, operators and precedence
ex4.java Console input using the Scanner class
ex5a.java
ex5b.java
ex5c.java
ex5d.java
Examples demonstrating Java control structures (if statement, while loop and for loop)
forexamples.java Some simple for loop examples
ex6.java Using Java switch and some output formatting
ex7.java Static methods, parameters and local variables
ex8.java Java reference types
ex9.java Data encapsulation, objects and methods
ex10.java
IntCircle.java
Simple example of a class
CD.java
Song.java
CDTest.java
songs.txt
More complex class example (refer back to this when needed)
ex11.java
ex11.txt
Simple intro to Java arrays and text files
ex12a.java More on Java arrays, references and searching
ex12b.java
Scores.java
Arrays as instance variables, resizing arrays, shared data vs. separate copies of data, private methods
ex13.java Two-dimensional arrays
ArrayL.java ArrayLists and some of their abilities
ex14.java
SortInt.java
Simple sorting with SelectionSort and InsertionSort
BinarySearchDemo.java Binary Search example
ex15a.java
ex15b.java
ex15c.java
ex15d.java
Intro to simple graphical components in Java
Counters.java Using JPanels to subdivide a window
Counters2.java Extending JPanel to tailor a panel to specific needs
ex16.java
Laughable.java
Booable.java
Simple intro. to interfaces in Java
ex17.java
MyInteger.java
Using wrapper classes and parsing integers
ex18.java Using the Character class
ex19.java
SuperClass.java
SubClass.java
Subby.java
Simple example of inheritance
ex20.java
RationalClass.java
MixedNumber.java
MixedNumber2.java
Inheritance vs. Composition
ex21.java Operator overloading
ex22.java Demonstration of subclassing polymorphism in Java
ex23.java Demonstration of abstract classes in Java (compare to ex22.java)
ex24.java
SortAll.java
Generic access in Java
ex24T.java
SortAllT.java
Safer generics with parameterized types and methods
ex25.java Intro. to Java Exceptions
ex26.java Comparing binary and text files
ex27a.java
ex27b.java
CDSerial.java
SongSerial.java
Object input and output streams and Serializable objects
recursion.java Intro. to recursion
ex28.java Intro. to Data Structures concepts