Anonymous class

tcak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 12 04:56:21 PDT 2016


I feel like I remember that this was added to D a while ago, but 
I am not sure. Is it possible to create anonymous classes?

public interface Runnable{
     void run();
}


runIt( new Runnable(){
     void run(){
         /* do stuff */
     }
});

I want to do this without making the things any complex.


More information about the Digitalmars-d-learn mailing list