This week's giveaway is in the Testing forum. We're giving away four copies of TDD for a Shopping Website LiveProject and have Steven Solomon on-line! See this thread for details.
I am passing input as a file. It's reading data from file and printing required output. Even finally block is getting executed. Below is the output which I am getting.
Sum of numbers in file is 112
helo
After completion of finally block it's not getting terminated
Did you add a print statement at the end of the program just before the ending } for the main() method? Did it print anything?
I think some thread is holding JVM from closing
From the API doc for the Thread class:
The Java Virtual Machine continues to execute threads until either of the following occurs:
The exit method of class Runtime has been called and the security manager has permitted the exit operation to take place.
All threads that are not daemon threads have died, either by returning from the call to the run method
or by throwing an exception that propagates beyond the run method.
The Java Virtual Machine exits when the only threads running are all daemon threads.
Make sure all the GUI objects have been fully released so any threads associated with them end.