When should we really use finalize() method in java?
If we want to close connection in finalize() method then it's better to use the code below as waiting for GC to call finalize() method and then release the connection does not make sense
try{
// Connection creation
}finally{
//close connection
}
So the question is does finalize() method has any relevance today?