1、assert <boolean表達式>
如果<boolean表達式>為true,則程序繼續(xù)執(zhí)行。
如果為false,則程序拋出AssertionError,并終止執(zhí)行。
2、assert <boolean表達式> : <錯誤信息表達式>
如果<boolean表達式>為true,則程序繼續(xù)執(zhí)行。
如果為false,則程序拋出java.lang.AssertionError,并輸入<錯誤信息表達式>。
1、assert <boolean表達式>
如果<boolean表達式>為true,則程序繼續(xù)執(zhí)行。
如果為false,則程序拋出AssertionError,并終止執(zhí)行。
2、assert <boolean表達式> : <錯誤信息表達式>
如果<boolean表達式>為true,則程序繼續(xù)執(zhí)行。
如果為false,則程序拋出java.lang.AssertionError,并輸入<錯誤信息表達式>。