Java console cross-zero