What is 'finally' method in Exceptions?

Answer Posted / k.k

ALL ANSWERS GIVEN ABOVE ARE WRITE.........


BUT

ONLY CASE THAT CAN SUPPRESS THE FINALY BLOCK IS

public class SupressFinallyExample
{

public static void main(String args[])
{

try
{
// the code that may cause an exception
//System.exit(0);
}
catch (Exception e)
{
System.exit(0);//if exception occure..
}
finally
{
// code to be executed irrespective of the
occurrence of exception
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is thread count in java?

547


What is strings in java?

591


Does java have a compiler?

558


What are parameters in a method?

585


Why do we create threads in java?

582






What are static blocks and static initalizers in java ?

587


Which is faster string or stringbuilder?

521


What is mean by collections in java?

564


How to create a base64 decoder in java8?

559


What are disadvantages of java?

521


Describe method overriding

589


Explain differences between checked and unchecked exceptions in java?

640


What is thread safe in java?

553


Can you explain the private protected field modifier?

571


What is unmodifiable list in java?

536