2552O: Java Preparatory Course for PGT in CS
Leaders: Dr Jennie Palmer and Dr Nick Cook
Duration: 26th August 2008 - 19th Sept 2008
Course Outline
Two main themes:
- Objects, Collections and Data Structures
- Introduction to Java, Objects, Collections and Data Structures
- References, classes and inheritance, the Object Class
- Interfaces, generics and autoboxing
- The Collections Framework
- Data structures, sorting and searching algorithms
Good programming practice
- Packages, class and member visibility, documenting code
- Defensive programming, immutability
- Composition versus inheritance
- Factory classes, implementation independence
- Garbage collection and "memory leaks"
Materials from the two themes will be interspersed throughout the course. However, materials within a given theme will be delivered in the order shown:
Introduction to Java, Objects, Collections and Data Structures
- Programs, programming, programming environments
- Java Programming language: comments, types, variable declarations, arithmetic and boolean expressions, assignment
- Control-flow abstractions: 'if', 'while' and 'do', 'switch' , 'for'
- Input and output
- Introduction to data structures: arrays and array lists, dynamic memory allocation
- Introduction to simple algorithms: searching, sorting
- Methods
References, classes and inheritance, the Object Class
- Difference between primitive and reference types; object and reference creation; equality versus identity; object deletion
- Definition of classes, superclasses and subclasses; inheritance hierarchies; implementing inheritance; dynamic binding, method overriding, extending and overloading
- Methods provided by the Object class; rules for overriding Object methods; instanceof and this; implementing equals, hashCode and toString (and static valueOf)
Interfaces, generics and autoboxing
- Definition and purpose of interfaces; interface type hierarchies; "mixin" and strategy interfaces and polymorphism; interfaces, abstract classes and good practice
- Introduction to the use and definition of generics
- Autoboxing primitive types and auto-unboxing wrapper classes
The Collections Framework
- Collection and Map interfaces, abstract types and implementations (including Iterable and Iterator types)
- Comparable and Comparator interfaces and sorting
- Utilities to operate on collections and arrays for searching etc.
Data structures and algorithms
- Implementation of simple linked list and hashtable data structures
- Algorithms for sorting and searching
- Introduction to computational complexity of operations over data structures
Good practice
- Use of package namespaces; accessibility of class members; method length and complexity; documentation
- Composition versus inheritance
- Static factory methods and implementation independence
- Garbage collection and "memory leaks"
Please note that there is a short, follow-on course on tool support for Java programming, including: the Ant build tool, the Eclipse IDE, static analysis of code, version control with Subversion and unit testing. If you are interested, please contact Paul Ezhilchelvan (Paul.Ezhilchelvan@ncl.ac.uk).
