Java?????????
???????????? ???????[ 2015/9/11 13:36:51 ] ??????????????? ???????????
????2??Exception
????Exception ?????????? Throwable ???????????????????????ó?????????????????????????????????????
????3??Error
????Error ?? Throwable ???????????????????????????????????????????????ó??????????????????????
????????и÷????????????????????throws???????????????в???? Error ???κ????????Java?????????????????????????????п???????????????????????try...catch???????????????throws???????????????????????????
????4??RuntimeException
????RuntimeException ????Щ?????? Java ????????????????????????????Java?????????????????????????????п???????????????????????try...catch???????????????throws????????????????????????????????????????????????????????
????5??ThreadDeath
???????? Thread ???д?????????? stop ???????????????????? ThreadDeath ?????
??????????ó????????????????????????ò????????????????? ThreadDeath ?????????????????????????????????????????????????????????????
?????????в??? ThreadDeath??????????????????????
??????? ThreadDeath ????“????????”???????????? Error ??????????? Exception ??????????????ó????????г???? Exception???????????????
????????????й???API?????????????÷??????????????????????????????????÷??ο?Java API?????
????????Java?????????
?????????????????????????????????
??????????????????try...catch?????????????catach???????ж????????????????????磺
????public void p(int x){
????try{
????...
????}catch(Exception e){
????...
????}finally{
????...
????}
????}
???????????????????????????????????????????????????throws?????????????磺
????public void test1() throws MyException{
????...
????if(....){
????throw new MyException();
????}
????}
???????????????????????????????????????÷??????????????У?Java?????????????????????????????????????????????????????????????????????catch?????????Java?????????????????????main()??????????????????????????????飬?????????????賬???
?????????????????????printStackTrace()???????????????????????????
????????????????????????????????????????????????????????????????????????????????????С?
?????????????????????????紦??????????????????С???????????Χ??С?????????????????????????????????
???????????????????finally??????κ?????????????е???????????????Щ???κ?????????????д????????????磬??????????????????????JDBC???????finally???????return?????У????????????λ???????????try?????????finally???????е??????????????System.exit()??????System.exit()?????????????????????е? Java ???????finally?????в??????????????????????return????????????鯔???finally???????return?????????廹??????′???
????????????????????????????
?????????try??????????????????catch??finally??? try...catch...finally??try...catch??try...finally???????catch?????????????????finally?????????try??catch??finally?????????????????????á?
?????????try??catch??finally??????????б??????????????????????????????????????????ж???????????????????????嵽??Щ??????檔
?????????????catch?????Java??????????????????????????????????catch?飬??????????б??catch?顣
?????????throw?????????н??????????????Щ??л?????С?
???????塢??????????????????????????????????????????????????????????????????????
??????????ж??????????????????????????????????????????????throws???????????throw?????????????????????throws??????
????throw??throws??????????
????throw????????????????????????????????throw ??????
????throws???????????????????????????????????????????throws ??????1????????2...??????n??
?????????ζ???????????
????1????????е??????????IOException??SQLException??
????try{
???????????
????}catch(IOException ioe){
???????????
????}catch(SQLException sqle){
???????????
????}finally{
???????????
????}
????2???????????
????????Exception????RuntimeException???????????????????????????:
????public class MyException extends Exception{
????public MyException(){}
????public MyException(String smg){
????super(smg);
????}
????}
????3?????????????
??????throws?????????????????????????????throw????????????????????????????磺
??????????????????
????public void test1() throws MyException{
????...
????if(....){
????throw new MyException();
????}
????}
?????????????????????????????????????
????public void test2() throws MyException{
????...
????try{
????...
????}catch(SQLException e){
????...
????throw new MyException();
????}
????}
????????????????????????
????public void test2() throws MyException{
????...
????try {
????...
????} catch (MyException e) {
????throw e;
????}
????}
??????δ??????????????????????????г????????????壬??????????????????????????????????????????throws?????????????????????????Щ???????????
?????塢???????????????
????Exception?????????????????????????????
????1?????????
????RuntimeException???????????????????????????????????Java?????????????????????????????п???????????????????????try...catch???????????????throws??????????????????????????????磬?????????????????java.lang.ArithmeticException????
????2????????
????????RuntimeException????????????????Exception?????????????????????????????????????try...catch???????????throws??????????????????????????
????3???????????
??????????????????ó????????е??????????????????????????????????????????????????????????ó????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????public class HelloWorld {
????public static void main(String[] args) {
????System.out.println("Hello World!!!");
????try{
????System.out.println(1/0);
????}catch(ArithmeticException e){
????System.out.println("?????0!");
????}
????System.out.println("????????????????????????!!!");
????}
????}
???????н????
????Hello World!!!
?????????0!
????????????????????????????!!!
????4???????????
????Error??????????????????????????Java???????????JDK?????????Щ??????????VirtualMachineError
??????OutOfMemoryError????????????????Щ????.???????Error????????????????????????RuntimeException????????????е???????????????????????????????????
????Error??????????????????????????????:Java?????????????????????????????????????????????????С?
????5??????????
?????????????????????????try...catch?????????????????????????Σ?????????????????????????????????????????????????????????????????????е??????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????try...catch?????????????throws?????
????????Error????????????????????????????κδ?????????????????????????????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????