![]() |
| Home | Tech FAQ | Interview Questions | Placement Papers | Tech Articles | Learn | Freelance Projects | Online Testing | Geeks Talk | Job Postings | Knowledge Base | Site Search | Add/Ask Question |
![]() Related Questions If a checked exception may be thrown within the body of a method, the method musteither catch the exception or declare it in its throws clause. Latest Answer : this rule is actually for handling the exceptions:that is there are two ways by ehich u can handle the exception :1:either you use the try catch statement and enclose the appropriate code in the try catch block,this is called as the catch or the HANDLE ... The finally clause is used to provide the capability to execute code no matter whether ornot an exception is thrown or caught. Latest Answer : In try,catch clauses either try clause(If exception is not happend) or catch clause(If exception occures) is exicuted.If we want to exicute a block of statements doesn't depend on exception then we put those block of statements in finally ... A catch clause can catch any exception that may be assigned to the Throwable type. Thisincludes the Error and Exception types. Yes, an exception can be rethrown. The finally clause of the try-catch-finally statement is always executed unless the threadof execution terminates or an exception occurs within the execution of the finally clause. An uncaught exception results in the uncaughtException() method of the thread'sThreadGroup being invoked, which eventually results in the termination of the programin which it is thrown. What happens if a try-catch-finally statement does not have a catch clause to handlean exception that is thrown within the body of the try statement The exception propagates up to the next higher level try-catch statement (if any) orresults in the program's termination. When an exception is thrown within the body of a try statement, the catch clauses of thetry statement are examined in the order in which they appear. The first catch clause that iscapable of handling the Latest Answer : If you are trying to catch the specific exception , write that catch clause prior to the other / general clauses.Otherwise the compilation error "The Exception already been caught" will occur.Try this code:try {// some code}catch(Exception ... Answered by Scott on 2005-05-12 09:50:36: An Exception can be caught and recovered: ArrayIndexOutOfBoundsException means you tried to access a position of an Array that does not exist - no big deal. An Latest Answer : exception will give user friendly message which is defined in exception handling,whereas error message is standard given by oracle. ... Latest Answer : Java supports exception handling by its try catch constructs. Java API define exception classes for such conditions. These classes are derived from java.lang.Throwable class. User defined exceptions are those exceptions which an application provider or ...
Sponsored Links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||