
-----------------------------------
octopi
Tue Mar 02, 2010 7:01 pm

What is this called?
-----------------------------------
[code]
        this.aMethod( new SomeClass() {
            public void someMethod() {
                //new definition
            }
        });
[/code]

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.

-----------------------------------
chrisbrown
Tue Mar 02, 2010 7:49 pm

RE:What is this called?
-----------------------------------
Overriding using instance initialization. The search results aren't very helpful even with the right keywords.

-----------------------------------
TheGuardian001
Tue Mar 02, 2010 8:06 pm

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.

-----------------------------------
chrisbrown
Tue Mar 02, 2010 8:33 pm

RE:What is this called?
-----------------------------------
Wow, I was way off. Just wanted to add that they're anonymous classes, specifically.
