-
Java ArrayList: A List That Can Grow (Beginner) →
Episode 19 of Complete Modern Java. An array keeps its length; an ArrayList grows and shrinks. Add, get, size, remove and contains, why a list of int does not compile, an index out of bounds, and the same list in TypeScript.
-
Java Exceptions: Try, Catch and Keep Going (Beginner) →
Episode 18 of Complete Modern Java. One bad value stopped the whole program: read the stack trace, catch the exception with try and catch, see both paths, catch a NumberFormatException, and handle errors in TypeScript.
-
Java Encapsulation: Private Fields, Getters and Setters (Beginner) →
Episode 17 of Complete Modern Java. Make an object refuse bad data: give the class its own file, make its fields private, read them with getters, change the price with a setter that checks, and see how TypeScript private differs.
-
Java Classes and Objects: One Class, Many Objects (Beginner) →
Episode 16 of Complete Modern Java. Make your own type: a class with fields, objects made with new, the default values Java fills in, a constructor with this, a method on the object, an array of objects, and the same class in TypeScript.
-
Loop Over a Java Array: The One Character That Crashes It →
Episode 15 of Complete Modern Java. Add up every value in an array with one loop: the index loop, why it stops before the length, the one character that crashes it, the for-each loop, an empty array, and the same loops in TypeScript, where the mistake gives NaN.
-
Java Arrays: Indexes and Out of Bounds (Complete Beginner) →
Episode 14 of Complete Modern Java. Keep many values under one name: a first array, indexes that start at 0, changing one value, the out of bounds exception, printing with Arrays.toString, and the same array in TypeScript.
-
Java Methods: void, Parameters and return (Complete Beginner) →
Episode 13 of Complete Modern Java. Name a set of instructions once and use it again: a void method, what happens when it is called, parameters and arguments, return and a result, and the same three as TypeScript functions.
-
Java Loops: while and for (Complete Beginner) →
Episode 12 of Complete Modern Java. Stop copying lines: the while loop and its three parts, the loop that never ends and Ctrl+C, the for loop and i++, why 0 to < 3 prints 0 1 2, a running total with +=, and the same loops in TypeScript.
-
Java and, or, not and else if (Complete Beginner) →
Episode 11 of Complete Modern Java. A shop with three rules: && and || and ! with truth tables, else if where the first true condition decides, why branch order matters, how && skips a division by zero, and the same rules in TypeScript.
-
Java if and else: Make Your Program Decide (Complete Beginner) →
Episode 10 of Complete Modern Java. Free delivery from $50: a comparison gives a boolean, if and else choose exactly one branch, the six comparison operators, > against >= at the boundary, the = versus == trap, and === in TypeScript.