Here are 30 "write a program" questions drawn from your first 15 topics. I skipped Java Basics, JVM/JDK Tools and a dedicated Garbage Collection block, since they don't lend themselves to full programs (Q24 still covers GC). Each question should be its own .java file with a main method, unless it says otherwise.
Data Types & Variables
Math.addExact in a try/catch. Also show widening, and narrowing by casting 200 to byte.== and equals for values 127 and 128. Add an autoboxing/unboxing case that throws a NullPointerException, and handle it.0.1 + 0.2 != 0.3, then compare doubles using an epsilon. Compute compound interest with BigDecimal, rounded to 2 decimals with HALF_UP.Operators & Control Statements
Integer.bitCount, swap two ints without a temp, reverse the bits of an int, and find the single non-repeating element in an array using XOR.+ - * / and parentheses using two stacks (no scripting engine, no libraries).break to find the first row whose sum is a perfect square, and a labeled continue to skip rows containing a negative number.yield, handling leap years correctly.@FunctionalInterface TriFunction<A,B,C,R>. Build a calculator that maps operator strings to BinaryOperator<Double> lambdas and method references. Show andThen composition and a lambda capturing an effectively final variable.Arrays
int[][], sorting with Arrays.sort and a custom comparator.OOP (Classes, Encapsulation, Inheritance, Polymorphism)
Account with private fields, validated deposit/withdraw, transfer between accounts, and an immutable Transaction class. Store history in a plain array that grows when full (no collections).