The assertion java

Today, with a smart idea to emerge a hint assert keyword, Leng Shimo understand !!! still too dishes. Internet search a bit, this keyword is asserted.

 

What is asserted?

I do not know, anyway, is the operation of the jvm. java error is divided into two kinds, one called error, called Exception okay with this. General as long as the program can be up and running, even if the middle of an exception, is thrown Exception, you've seen thrown XXXError do?

If the program is running even if there is error does not run up. So much nonsense, that is to say, if the assert expression behind is false, java virtual machine will throw a Caused by: java.lang.AssertionError: ***

Program stopped. We will not continue to run. So normal production environment will not be asserted, jvm is off by default.

 

 Probably java program is so written.

Many of which are online eclipse open the way, I am here to open the way to the record about the idea

 

 In this way, then I do not say. Figure on the line

Guess you like

Origin www.cnblogs.com/Tiandaochouqin1/p/12166566.html