Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public interface

AutoCloseable

java.lang.AutoCloseable
Known Indirect Subclasses

Class Overview

Defines an interface for classes that can (or need to) be closed once they are not used any longer. Calling the close method releases resources that the object holds.

A common pattern for using an AutoCloseable resource:

        
         Closable foo = new Foo();
   try {
      ...;
        
        finally {
      foo.close();
   }
 }
       

Summary

Public Methods
abstract void close ()
Closes the object and release any system resources it holds.

Public Methods

public abstract void close ()

Closes the object and release any system resources it holds.