- Introduction: Topic of the course
- Principles of programming in Java
- Concepts: values, variables, types, methods, parameters, arguments, return values, classes, fields, objects, object creation, object references, method activations and the call stack
- First steps in modular programming Part 1 Part 2
- Example: squareroot
- Example: max3
- Example: timeofday
- Concepts: Using Eclipse, creating JUnit test cases, creating classes, instance methods, encapsulation,
private
versuspublic
, using Git, constructors, unit testing basics and best practices
- Managing complexity through modularity and abstraction
- Concepts: modularity, abstraction, API, client module, importance of documentation, information hiding, procedural abstraction, data abstraction, immutable versus mutable abstractions, abstract value/state of an object, Java's built-in datatypes and operators
- Representation objects and representation exposure
- Concepts: representation object, representation exposure
- How to properly document single-object abstractions
- Concepts: defensive programming, contractual programming, preconditions, postconditions, class representation invariants (= private class invariants), class abstract state invariants (= public class invariants), getters, mutators
- Polymorphism
- Concepts: abstract classes, polymorphism, subclassing, inheritance,
instanceof
, the static type checker, static/dynamic type of a variable or an expression, typecasts, pattern matching; class Object, autoboxing and -unboxing
- Concepts: abstract classes, polymorphism, subclassing, inheritance,
- Dynamic binding
- Concepts: dynamic binding, abstract methods, method overriding,
@Override
; methodsequals
,hashCode
,toString
,getClass
; record classes
- Concepts: dynamic binding, abstract methods, method overriding,
- Behavioral subtyping: modular reasoning about programs that use dynamic binding
- Example: intlist_inheritance
- Concepts: Non-modular reasoning, modular reasoning, method specifications, correctness of methods; method call resolution, resolved method vs called method, static versus dynamic method call binding; strenghtening of specifications, behavioral types, behavioral subtyping
- Interfaces
- Concepts: interfaces, multiple inheritance, static fields, the Singleton pattern
- Implementation inheritance
- Concepts: Inheritance of fields and methods,
super
constructor calls,super
method calls
- Concepts: Inheritance of fields and methods,
- Closed types
- Concepts: types with a closed set of instances, enum classes, types with a closed set of direct subtypes, sealed types, switch statements and expressions
- Lists, sets, and maps
- Concepts: the List, Set, and Map abstract datatypes (ADTs); the ArrayList, LinkedList, HashSet, and HashMap data structures; the Java Collections Framework
- Single-class entity-relationship abstractions
- Example: html
- Concepts: entity graphs, multi-object abstractions, bidirectional associations, consistency of bidirectional associations, peer objects, peer groups
- Multi-class entity-relationship abstractions
- Concepts: packages, package-accessible fields/constructors/methods/classes, package representation invariants, package abstract state invariants,
HashSet
- Concepts: packages, package-accessible fields/constructors/methods/classes, package representation invariants, package abstract state invariants,
- How to properly document multi-object abstractions
(Students of course H02C5A can ignore this material.)
- Iterators
- Concepts: (external) iterators, iterables, nested classes, inner classes, local classes, anonymous classes, enhanced
for
loop, internal iterators, lambda expressions, capturing outer variables, effectively final variables
- Concepts: (external) iterators, iterables, nested classes, inner classes, local classes, anonymous classes, enhanced
- Streams (on the web)
- Concepts: streams, sources, map, filter, reduce, collect, parallel streams
- Generics
- Concepts: generic class, generic interface, type parameter, type argument, generic type instantiation, parameterized type, bounded type parameter, covariance, contravariance, invariance, upper-bounded wildcard, lower-bounded wildcard, generic method, erasure, unchecked cast warning