3 ms·
Anonymous types are a thing in some languages. You also have adjacent concepts like anonymous namespaces in which you can dump types that require a name so that
by jandrewrogers 2y ago
Anonymous types are a thing in some languages. You also have adjacent concepts like anonymous namespaces in which you can dump types that require a name so that the names don’t leak out of the local context.
Sufficiently flexible namespaces do solve most of these problems. Java is kind of perverse though.
- gleenn 2y agoJava: Map m = new HashMap() {{ System.out.println("I am a unique subclass of HashMap with a single instance!");}};