An Automatically Managed Resource that can either be used once (e.g. reading an input stream) or multiple times (e.g. reading a file).
The purpose of Resource is two-fold:
1 - To automatically handle closing a resource after it is done being used.
2 - To abstract the fact that some resources can be read multiple times while other resources are one-time use.
An Automatically Managed Resource that can either be used once (e.g. reading an input stream) or multiple times (e.g. reading a file).
The purpose of Resource is two-fold: 1 - To automatically handle closing a resource after it is done being used. 2 - To abstract the fact that some resources can be read multiple times while other resources are one-time use.