what is the purpose of the final in the try-catch-final

Answers were Sorted based on User's Feedback



what is the purpose of the final in the try-catch-final..

Answer / vikas

final- declares a constant
finally- handles exceptions
finalize- helps in Garbage collection

Is This Answer Correct ?    10 Yes 1 No

what is the purpose of the final in the try-catch-final..

Answer / srinivasa

Finally is a block where we can write the code to free up
the resources like File closing,socket obj closing .

Is This Answer Correct ?    6 Yes 0 No

what is the purpose of the final in the try-catch-final..

Answer / ramakrishna challapalli

finally is an optional one its not a mandatory statement
after try-catch blocks

Is This Answer Correct ?    3 Yes 0 No

what is the purpose of the final in the try-catch-final..

Answer / 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

what is the purpose of the final in the try-catch-final..

Answer / maha

That's not final,that one is finally, which is followed
after the try-catch block,It helps "garbage collection".

Is This Answer Correct ?    3 Yes 3 No

what is the purpose of the final in the try-catch-final..

Answer / srinivas

After executing try catch statements last statement is
finally it must execute in at anycase

Is This Answer Correct ?    0 Yes 0 No

what is the purpose of the final in the try-catch-final..

Answer / madhu

yes it correct it is finally,the use of finally is,if we
did not catch the exception in try/catch block also finnaly
will catch.

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More Core Java Interview Questions

How do you implement singleton class?

1 Answers  


How do you reverse a string in java?

1 Answers  


Difference between ?System.out.println? and ?System.error.println??

8 Answers   Sai Softech,


When throws keyword is used?

1 Answers  


According to java operator precedence, which operator is considered to be with highest precedence?

1 Answers  


What is a literal coding?

1 Answers  


What is the exact difference in between unicast and multicast object? Where we will use?

1 Answers  


How can i add a button in applet in java ???

2 Answers  


Integer.parse Int(bf.readLine(System.out.println("enter value for n["+m+"]:"))); can it run under this

1 Answers  


What is functional interface in java example?

1 Answers  


Explain about fail safe iterators in java?

1 Answers  


What are the Class Libraries ?

1 Answers   Wipro,


Categories