Dispose pattern: Difference between revisions

Content deleted Content added
Motivation: elab, narrowly about exceptions
m Exceptions: wording
Line 33:
Resource resource2 = null;
try {
// AttemptConditionally attempt to acquire the resource.
if (condition) {
// Attempt to acquire the resource.
resource = getResource();
}
try {
resource2 = getResource();