Computer Science Canada

What is this called?

Author:  octopi [ Tue Mar 02, 2010 7:01 pm ]
Post subject:  What is this called?

code:

        this.aMethod( new SomeClass() {
            public void someMethod() {
                //new definition
            }
        });


What would you call this (overriding a method when its being instantiated)?
I'm trying to found out more about it, but don't know the proper name for it. Google hasn't been too helpful.

Author:  chrisbrown [ Tue Mar 02, 2010 7:49 pm ]
Post subject:  RE:What is this called?

Overriding using instance initialization. The search results aren't very helpful even with the right keywords.

Author:  TheGuardian001 [ Tue Mar 02, 2010 8:06 pm ]
Post subject:  Re: What is this called?

I believe "inner class" would be what you're looking for, and it seems to be more helpful in terms of google results.

Author:  chrisbrown [ Tue Mar 02, 2010 8:33 pm ]
Post subject:  RE:What is this called?

Wow, I was way off. Just wanted to add that they're anonymous classes, specifically.


: