Here we’ll be covering Java assertion statements which allow us to set pre conditions for our functions and ensure that our programs are meeting the constraints laid out for them.
Including these throughout your Java code can allow you to pinpoint your errors straight away and can also allow us to include a precise error message so that we know exactly what to do. As we begin to approach more complex topics, our Java programs will begin to grow and so of course that means so will their complexity, hence, being able to make strong assertions is important in writing valid code and catching any bugs.
Feel free to check all the Java code for this video below and like, share and subscribe !
https://github.com/HarshilsHowTo/13-Java-Assert-Statements/blob/master/JavaAssertStatements.java