java exit while loo code example Example: java how to exit loop //how to exit loop in java while (true) { if (obj == null) { break; } }