Exception Vs Assertion
问题 What is the difference between Java exception handling and using assert conditions? It\'s known that Assert is of two types. But when should we use assert keyword? 回答1: Use assertions for internal logic checks within your code, and normal exceptions for error conditions outside your immediate code's control. Don't forget that assertions can be turned on and off - if you care about things like argument validation, that should be explicit using exceptions. (You could, however, choose to perform