Tuesday, November 29, 2011

what happens if we execute the program?

class Return{:The above code will display nothing it will compile and execute no error will come it will first do to try and then finally.:The code will execute the try block but since it will always go to the the finally block so the return will override anything that is in the finally block. So in this case it will display 2.:It will display the output 2, because the code will execute the finally block
Category:Java Interview Questions

No comments:

Post a Comment