Question: hello everyone
how to select multiple cell from table using jquery . i dont want to use any plugin for this.
i have to two tables which are dynamically generated.

Answer: 
The common term or these inline class definitions is Anonymous Classes.

You can read more about the discussion on these in [Java/Android: anonymous local classes vs named classes](https://stackoverflow.com/q/3577013/808940)

Essentially the main differences are readbility, speed of coding, re-use and scope.

From a resource point of view the anonymous class creation may cause an overhead in the garbage collector as discussed in [Avoid Creating Unnecessary Objects](http://developer.android.com/guide/practices/design/performance.html#object_creation). I am not certain on the exact details of anonymous class creation, however, it is logical that implementing the interface on the class is more efficient.

@WilliamTMallard has provided an example of what **NOT** to do. In his example, a long and syntacticly complex handler should be implementented on the class rather than anonymous handler because it is harder to read and edit when defined inline.
There is a danger in using anonymous classes in Android. As described in [this blog post](http://www.androiddesignpatterns.com/2013/01/inner-class-handler-memory-leak.html?showComment=1387475947875#c5406161336938634644) -

> 
> In Java, non-static inner and anonymous classes hold an implicit
>  reference to their outer class. 
> 
> 
> 

And here comes an opportunity for a leak.

So, the short answer would be: implement the interface methods or use static inner classes (which don't hold an outer class reference).

For instance, a leak-safe Handler could look like this:

```
private static class ChangeTextHandler extends Handler {
    private final WeakReference activity;

    public ChangeTextHandler(MainActivity activity) {
        this.activity = new WeakReference<>(activity);
    }

    @Override
    public void handleMessage(Message msg) {
        MainActivity activity = this.activity.get();
        if (activity == null) {
            Log.e(TAG, "Activity is null ChangeTextHandler.handleMessage()!");
            return;
        }

        final String text = (String) msg.getData().get(BUNDLE_KEY);
        if (!TextUtils.isEmpty(text)) {
            switch (msg.what) {
                // do something
            }
        }
    }
}

```

I made a [blog post around usage of Handlers](http://lomza.totem-soft.com/tutorial-how-to-use-a-handler/), so might be worth checking as well :)