what is the purpose of the final in the try-catch-final
Answer Posted / guest
finally will execute after catch block if try throw
exception else it will execute after try.
ex:
class a
{
public static void main(String []asd)
{
try
{
throw new Exception();
}catch(Exception e)
{
System.out.println("catch");
}
finally{
System.out.println("finally");
}
}
}
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is the difference between length and length () in java?
What do you understand by the term singleton?
How do you make a thread in java?
What does s mean in regex?
What are different types of classloaders?
Give me example of derived data types.
How many functional interfaces does java 8 have?
What is the difference between serializable and externalizable interfaces?
What is method in java ?
What is an infinite loop? How infinite loop is declared?
How do you override a method?
How do you implement singleton class?
What is the benefit of abstract class?
Explain creating threads by implementing runnable class?
What are Normalization Rules? Define Normalization?