Home / Java Tips Generated By ChatGPT / The assert Statement in Java Assertions are used for debugging purposes, throwing an AssertionError if the condition is false. Enable assertions with the -ea JVM option. Source Code int age = 15; assert age >= 18 : "Cannot vote";