¡@

Home 

2014/10/16 ¤W¤È 08:19:52

android Programming Glossary: myholes

When exactly is it leak safe to use (anonymous) inner classes?

http://stackoverflow.com/questions/10864853/when-exactly-is-it-leak-safe-to-use-anonymous-inner-classes

The key here is the constructor... public class SwissCheese Can't have swiss cheese without some holes public Leak myHoles public SwissCheese Gotta have a Factory to make my holes LeakFactory _holeDriller new LeakFactory Now let's get the holes.. Gotta have a Factory to make my holes LeakFactory _holeDriller new LeakFactory Now let's get the holes and store them. myHoles new Leak 1000 for int i 0 i i 1000 Store them in the class member myHoles i _holeDriller.createLeak Yay We're done Buh.. Now let's get the holes and store them. myHoles new Leak 1000 for int i 0 i i 1000 Store them in the class member myHoles i _holeDriller.createLeak Yay We're done Buh bye LeakFactory. I don't need you anymore... Now we have Leaks but no Factory...