Methods, arrays, strings and text blocks

Arrays come first in this part: the declaration, the initialiser and the default values, the algorithms written by hand, then Arrays.sort, binarySearch and copyOf, and two-dimensional grids, ragged ones included. Text follows: String and its methods, immutability, StringBuilder against the loop that is quadratic with +, String.format and printf, text blocks, splitting and joining. Then the wrapper classes and autoboxing, Math with BigInteger and BigDecimal and the cent a double loses, args with the exit status the shell sees, arrays of objects with their equals, and a capstone that counts the words of a text.

3.1 Arrays declaration, new, an initialiser, length, iteration, default values Open 3.2 Array algorithms by hand max, min, sum, average, reverse, linear search Open 3.3 Sorting and Arrays Arrays.sort, binarySearch, copyOf, fill, toString, deepToString Open 3.4 Two-dimensional arrays a grid, ragged arrays, nested iteration, a transposed matrix Open 3.5 String and its methods immutability, length, charAt, substring, indexOf, equals, compareTo, strip Open 3.6 StringBuilder append, insert, reverse, toString, and the loop that is quadratic with + Open 3.7 String.format and printf %s, %d, %f, %n, width, precision, %,d, a text table Open 3.8 Text blocks """, the closing delimiter, indentation, \s, \, a JSON string written as a text block Open 3.9 Splitting, joining and replacing split, join, replace, repeat, toUpperCase, matches Open 3.10 Wrapper classes and autoboxing Integer, parseInt, valueOf, the cache, null unboxing and the NullPointerException it causes Open 3.11 Math, BigInteger and BigDecimal Math methods, a long that overflows, BigInteger, BigDecimal and the cent a double loses Open 3.12 args, exit codes and System.exit the args array, a usage message, System.exit(2), the status the shell sees Open 3.13 Arrays of objects and equals an array of a class, null elements, a loop over it, the equals a comparison needs Open 3.14 Capstone: counting words a text, split, a Map, a sorted report, the same program with arrays Open

Lessons