What is "finally" keyword?

Answers were Sorted based on User's Feedback



What is "finally" keyword?..

Answer / k.santosh kumar

Finally:
finally is block of code written in exception handling.
finally block is executed irrespective whether exception as
occured or not. it will usefull when u want to close user
defined resources like file , opened resources(db stmts).

Is This Answer Correct ?    25 Yes 2 No

What is "finally" keyword?..

Answer / guest

FINALLY IS KEYWORD USED IN EXCEPTION HANDLING.
IT CREATES A BLOCK OF CODE TO BE EXECUTED AFTER TRY--CATCH
HAS COMPLETED AND BEFORE THE CODE FOLLOWING TRY--CATCH.

Is This Answer Correct ?    11 Yes 4 No

What is "finally" keyword?..

Answer / taniya

The finally is Java keyword that is used to defined a block
that is always executed in a try-catch-finally statement.It
is use after the try an catch block to handle the unexpected
exception occurred in the try block.

Is This Answer Correct ?    4 Yes 2 No

What is "finally" keyword?..

Answer / piyush pathak

finally :
finally is a java keyword.It is a block of statement which
is executed surley after the try-catch block whether method
returns normally or throws an exception.

Is This Answer Correct ?    2 Yes 0 No

What is "finally" keyword?..

Answer / rustam

Finally is a java keyword which define a block that surely executed whether an exception is generated or not. this block
is an optional but it is good to put when we want cleanup the resources.

Is This Answer Correct ?    2 Yes 0 No

What is "finally" keyword?..

Answer / ss

The finally is Java keyword that is used to defined a block
that is always executed in a try-catch-finally statement.
try{
int x=10/2;
}
finally{
system.out.println("i am from finally");
}
here compiler will not compliant.why?even though x=10/2,x=10/0.

Is This Answer Correct ?    1 Yes 0 No

What is "finally" keyword?..

Answer / ravikiran(aptech mumbai)

finally is used to conserve the resources before the
exception is being caught

Is This Answer Correct ?    4 Yes 4 No

What is "finally" keyword?..

Answer / seem a rana

final is the last class.that will never inherit further....
due to final key word... jus like ,,, final.test.

Is This Answer Correct ?    1 Yes 1 No

What is "finally" keyword?..

Answer / pathan muzafar

Finally is a keyword which is used execute the blocks after try and catch blocks even if exception occured or not in both try and catch block.

Note: Here,Block means collection of statements(variables,methods etc)....
Exception means Run time error during execution

Is This Answer Correct ?    0 Yes 0 No

What is "finally" keyword?..

Answer / sravanthi

In the finally block we usually have code that is used to
perform clean up activities corresponding to the code in the
try block.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What do you understand by the bean persistent property?

0 Answers  


What is double word?

0 Answers  


What is the difference between stringbuffer and stringbuilder?

0 Answers  


What are jee technologies?

0 Answers  


why not override thread to make a runnable? : Java thread

0 Answers  






84. try { 85. ResourceConnection con = resourceFactory.getConnection(); 86. Results r = con.query(”GET INFO FROM CUSTOMER”); 87. info = r.getData(); 88. con.close(); 89. } catch (ResourceException re) { 90. errorLog.write(re.getMessage()); 91. } 92. return info; Which is true if a ResourceException is thrown on line 86? 1 Line 92 will not execute. 2 The connection will not be retrieved in line 85. 3 The resource connection will not be closed on line 88. 4 The enclosing method will throw an exception to its caller.

1 Answers  


Write down program for following scenario. Use java coding standard. You have array list with some words in it..we will call it as dictionary….and you have a arbitrary string containing some chars in it. You have to go through each word of dictionary and find out if that word can be constructed with the help of chars from arbitrary string given. If you find the word print it else print none.

0 Answers   Rolta,


What are java packages? What is the significance of packages?

0 Answers  


Is null or empty java?

0 Answers  


Why bytecode is called bytecode?

0 Answers  


What is java literals?

0 Answers  


what are abstract functions?

0 Answers  


Categories