Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is it called when you override a method while calling a constructor? [duplicate]

Tags:

java

Is there even a term for this? It has completely escaped me.

Example:

TableLayout tableLayout = new TableLayout(context){
    @Override
    protected void onDetachedFromWindow(){
        super.onDetachedFromWindow();
        getRidOfDialog();
    }
};
like image 376
hooby3dfx Avatar asked Nov 05 '22 08:11

hooby3dfx


1 Answers

That is an inner class defined on method's parameter. I think that the term you're looking for is "Anonymous inner class".

like image 187
Heldraug Avatar answered Nov 10 '22 17:11

Heldraug