java note initialization and cleanup