how and when compiler knows that the Java code throws the
checked Exception.
Answers were Sorted based on User's Feedback
Answer / aruna
Checked or caught exceptions are those exceptions that the
application programmer created a catch block to handle them.
while compiling, the java compiler make sure that all the
checked exceptions must be caught by the applicaion
programmer.Those exceptions are called the application or
business logic exceptions.
Inside the method body, there are calls to other methods;
the compiler looks at each of their method signature, what
exceptions they declared to throw. There are two
possibilities, either exceptions are caught inside the
caller-method by a try-catch block, or the caller declares
to throw the exception to its caller.
| Is This Answer Correct ? | 18 Yes | 4 No |
Answer / vatsal doshi
When: At Compile Time
How: Complicated.
Checked Exceptions are those which a Java Compiler is capable of checking at compile time. These exceptions normally occur when some pre-definite methods from the Java API are used by programmer. So compiler identifies such method invocations in the code. If handled using catch, or specified in the throws clause, compiler compiles successfully. Otherwise, it shows a Compile Time Error Message of possibility of a Checked Exception
| Is This Answer Correct ? | 2 Yes | 0 No |
What is class??
What is bufferedwriter?
What is printwriter in java?
Is null or empty java?
What is the difference between Object and Instance?
what is the role of xml in core java?? and how we can use it?? can somebody give a sample program with explanation and from where i can read more about xml?????
0 Answers HCL, SAP Labs, Vital Soft,
Is string a class in java?
What is unicode with example?
1) Find the Merge point of two linked lists. 2) Swap two bits of integer. 3) Reverse individual words of the sentence. 4) Reverse string without using temp string.
What is meant by serialisation and deserialisation?
What is the difference between serial and throughput garbage collector?
what is purpose of writting public static void main(Strind arg[]) in java..?