-
Java HashMap: Find a Product by Name (Beginner) →
Episode 22 of Complete Modern Java. A HashMap links each key to a value: put and get, one value per key, remove, what a missing key gives back and how to check first, and the same idea with a TypeScript Map.
-
Loop Through a Java HashMap: Keys and Values (Beginner) →
Episode 23 of Complete Modern Java. Three ways through a map, keySet, values and entrySet, why a HashMap prints in its own order, and the same loop over a TypeScript Map, which keeps insertion order.
-
Java static and Constants: Values That Belong to the Class (Beginner) →
Episode 24 of Complete Modern Java. A static counter shared by every product, a static final constant, a static method, the two compiler errors static invites, and static readonly in TypeScript.
-
Java Interfaces: A Promise a Class Makes (Beginner) →
Episode 25 of Complete Modern Java. An interface, two classes that implement it, why public is needed, one variable with three objects, a method that never changes, and TypeScript interfaces that disappear at run time.
-
Java Inheritance Explained: extends and super (Beginner) →
Episode 26 of Complete Modern Java. The is-a test, a FreshProduct that extends Product, super in the constructor, inherited methods, @Override with super.describe(), one shelf where each object uses its own version, and the same in TypeScript.
-
Composition or Inheritance: When Not to Use extends in Java (Beginner) →
Episode 27 of Complete Modern Java. Code that compiles but models the wrong thing, is-a against has-a, why extending ArrayList breaks a cart's rules, how composition lets the cart choose its operations, and the catch in TypeScript private.
-
Java Abstract Classes: Share Code, Require Methods (Beginner) →
Episode 28 of Complete Modern Java. An abstract PaymentMethod whose finished totalCents calls an unfinished feeCents, card and cash filling in the fee, why you cannot create the parent, interface or abstract class, and what TypeScript abstract does at run time.
-
Java Polymorphism: One Method Call, Different Behaviour (Beginner) →
Episode 29 of Complete Modern Java. A checkout that asks what kind of payment it has, the same job done by letting each payment object answer, adding a voucher without changing the checkout, one variable with two objects, and the same in TypeScript.
-
Java Same Values, Two Objects: Removing From the Cart (Beginner) →
Episode 21 of Complete Modern Java. Java said Milk was not in the cart: two objects with the same values, == and equals on objects, removing the same object, a removeByName rule of our own, and the same idea in TypeScript.
-
Java List of Objects: A Shopping Cart That Adds Itself Up (Beginner) →
Episode 20 of Complete Modern Java. A list of Product objects, then a ShoppingCart class that owns the list and works out its own total: the import a class file needs, add, count and totalCents, refusing null, and the same cart in TypeScript.