I’m writing an implementation of a binary tree for my data structures class, where the only actual values are the leaves. These are always of char type, so my method of traversing the list was to iteratively break down the tree until a leaf (char was not declared) is found. Because i can’t check if a primitive is null, I used ‘u0000’ to check. This has worked for me, but the javadoc says “Relying on such default values, however, is generally considered bad programming style.” Is there any reason for this beyond preference, or could the output genuinely change depending on the runtime?
Unfortunately I cannot share any code, but this is less of a debugging question and more of a general Java question.