120k views
1 vote
A finally clause will execute:

a) only if the try statement that precedes it does not throw an exception

b) only if the try statement that precedes it throws an exception that is caught

c) only if the try statement that precedes it throws an exception that is not caught

d) only if the try statement that precedes it throws an exception, whether it is caught or not

e) in any circumstance

User Aiko
by
4.3k points

1 Answer

6 votes

Answer:

e) in any circumstance.

Step-by-step explanation:

It is used in exception handling in Java.Finally clause is used to execute important code such as closing stream ,closing connection to the file etc.

Finally clause is always executed no matter what for every exception handling case.

for ex:-

try{

// some code

}

finally

{

//This code will always be execute.

}

User Rmflow
by
5.6k points