java - Why do I need to call a close() or shutdown() method? -
i'm new in java background in c++ in high school years. i'm trying make , chose java programming language. i've done homework , lot "destructors" java, finalize() method, , close() or shutdown() methods. still think don't have idea of how should work (more info below of course) ok, concrete question why need call close() or shutdown() methods? in particular case i'm working class didn't develop handles smart card reader, i've seen case of file management, have call close() method, similar. isn't calling close() method same idea freeing memory in c++ (that sucks)? meaning, have take care of deletion or destruction of object... isn't gc for? it option class i'm trying use smart card reader not best, might better class implements finalize() method when no longer used , ready gc, frees memory (most native code) and/or frees hardware resources gc might not know how do. but file management classes? used , maintained, w...