Question: So I am trying to do something like this:

```
Class myClass <T>
{
    T connection;

    public myClass(T conn)
    {
       this.connection = conn;
    }

    public void close()
    {
       connection.close()
    }
}

```

Knowing that T will only be either Socket or BluetoothSocket (both has.close() method).

Is it possible to do such thing with generic class? (Right now I have error method .close() is undefined for type T)

Answer: 
Since [Socket](http://developer.android.com/reference/java/net/Socket.html) and [BluetoothSocket](http://developer.android.com/reference/android/bluetooth/BluetoothSocket.html) both implement [Closeable](http://developer.android.com/reference/java/io/Closeable.html), you can:

```
class myClass<T extends Closeable> implements Closeable
{
    T connection;

    public myClass(T conn)
    {
        this.connection = conn;
    }

    @Override
    public void close() throws IOException
    {
        this.connection.close();
    }
}

```
I'm pretty sure you just oversaw the obvious error you made. The code should be:

`connection.close()`,

since this is how you called the member. :)