Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Does java isempty check for null?

0 Answers  


What is array sorting in java?

0 Answers  


Are private methods final?

0 Answers  


Explain the importance of throwable class and its methods?

0 Answers  


why pointer is not used in java?

3 Answers  


Is java code slower than native code?

0 Answers  


Is list ordered in java?

0 Answers  


What is the purpose of garbage collection in java?

0 Answers  


What's the base class in java from which all classes are derived?

0 Answers  


hi to all,i have a question on static block. i saved below as test.java class test extends a { static { System.out.println("test static"); } public static void main(String []dfs) { } } class a { static { System.out.println("a static"); } public static void main(String []asdf) { } } o/p as static test static but if i change base class as test class then class test { static { System.out.println("test static"); } public static void main(String []dfs) { } } class a extends test { static { System.out.println("a static"); } public static void main(String []asdf) { } } o/p test static explain me why "a static" wasn't print in second code when it is in derived class

1 Answers  


what are different ways in which a thread can enter the waiting state? : Java thread

0 Answers  


Can a final variable be null?

0 Answers  


Categories