正在加载图片...
Exceptions in Java -a reminder In Java,the basic exception handling construct is to: try a block of code which normally executes ok catch any exceptions that it generates,and finally do anything we want to do irrespective of what happened before. If a thrown exception is not caught,it propagates out to the caller and so on until main. If it is never caught,it terminates the program. If a method can generate (checked)exceptions but does not handle them,it has to explicitly declare that it throws them so that clients know what to expect. 1212 Exceptions in Java — a reminder In Java, the basic exception handling construct is to: If a thrown exception is not caught, it propagates out to the caller and so on until main. If a method can generate (checked) exceptions but does not handle them, it has to explicitly declare that it throws them so that clients know what to expect. • finally do anything we want to do irrespective of what happened before. • catch any exceptions that it generates, and If it is never caught, it terminates the program. • try a block of code which normally executes ok
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有