Highlighting the main concepts from each chapter of the textbook.
A type defines what values a variable can take and the operations that can be performed with the variable.
Delegate.
In Java, you can delegate to a class by
using static
methods and attributes.
In Java, you can delegate to an object by invoking methods on the object.
Every method has a contract that specifies the preconditions and postconditions of a method invocation.
The compiler determines if a method can be invoked on an object by using early binding.
An object has state (its attributes).
An object has an identity (its location in memory).
An object has behaviour (its methods).
Objects (and classes) can be represented using a memory diagram.
A loop invariant is a condition that is always true at the bottom of the loop (after the last line of code in the loop body).
Strings are objects that masquerade as primitives in certain ways.
Strings are immutable.
Strings can be compared (implement Comparable
).
Strings can be matched using patterns called regular expressions.
Waterfall and iterative development.
Testing.
A UML class diagram describes the structure of a software system by showing the classes used in the system, details of the classes (their attributes and methods), and the relationships between the classes.
Aggregation means has-a.
Composition is aggregation with shared lifetime.
Aliasing, shallow copying, and deep copying.
Computational complexity.
Inheritance means is-a, or is-substitutable-for.
Child classes can specialize behaviour by overriding methods inherited from the parent class.
Java uses late binding to resolve which method to invoke (the parent version or the child version) at runtime.
Collections and maps are interfaces.
Lists are useful when you have a collection that you want to treat as a (numbered) sequence.
Sets are useful when you want only unique elements.
Maps are useful when you want to access elements using a key.
An iterator is an object that supports traversal through a collection.
An exception is an object that represents an exceptional event.
An exception object is thrown when an exceptional event occurs.
Exception objects can be caught by an exceptional handler.
Exceptions are implemented as an inheritance hierarchy.