/* * The Java definite assignment trap. * THIS CODE FAILS TO COMPILE. * Before a value can be used, Java requires that its value has been set. * So in the main below "int bb..." fails because we are trying to set the value of * bb to something from aa -- which has not been set. The print does not compile * for similar reasons * * @author gtowell * Created: Sep 2022 */ public class Defin { public static void main(String[] args) { int j = 9; int aa; if (j==9) { aa = 6; } int bb = aa+5; System.out.format("%d %d\n", aa, bb); } }