Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 What is this called?
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
octopi




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
chrisbrown




PostPosted: 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.
TheGuardian001




PostPosted: 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.
chrisbrown




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: