JavaVitualmachineErrorInternalErrorOutOfMemoryErrorStackOverflowErrorUnknownError
InternalErrorOutOfMemoryErrorStackOverflowErrorUnknownError
g128g
-DYD
g129g
7.2
JavaException(1)(2)throwsthrowstrycatch()
-DYD
Java/()
catch
publicvoidtroublesome()throwsIOException
throwsIOException
try
catch
finally
1
WU\FDWFKILQDOO\try/catchtrycatchtry
try{;}catch({;})//
catchtry/trytry
trycatchcatchtry/catch
//
trycatch
catch
catch
catch
try
catch
g129g
g130g
-DYDcatchcatchcatch)trycatchcatch
(catch
catchcatch
7.1
publicclassExceptionExam{publicstaticvoidmain(String[]args){inti=0;i=3/i;}}
JavaExceptionExamJava/
JavaJDK
java.lang.ArithmeticException:/byzer
oatExceptionExam.main(ExceptionExam.java:7)
ExceptionExamArithmeticExceptionJavaJava
main
ExceptionExam.javaException
71
trytrycatchArithmeticException7.2try/catchtrycatch
publicclassExceptionExam1{publicstaticvoidmain(Stringargs[]){inti,a;g130g
try{//i=0;a=42/i;return;
-DYD
g131g
}catch(ArithmeticExceptione){//System.out.println("}}}
");
trycatchcatchtry)trycatch
returncatchtrycatchtry/catch
trytry/catchtry(/try/catch3try
catchcatch
2try7.3
trytrycatchtrytry
trytry
publicclassExceptionExam2{publicstaticvoidmain(Stringargs[]){intdata1[]={2,4,6,8,10,12};intdata2[]={1,0,2,4,3};try{for(inti=0;i
g132g