Skip to main content
0 online
yay yayOG 2004

So I can have a variable hold the type of a class, and then later instantiate that class. That's really really wild.

I'm sure C# has this, but I wasn't expecting in java.

Reminds me of .NET that has this sweet ability that you can compile C# code and then run it from within the library itself (not just system calls for programs, but the lib itself exposes the methodology of the compilers). IIRC

deanh77 deanh77Founder

yeah, not typical, but some things take advantage of that.

For example, In Spring, you configure instances of (typically Singleton) objects in an XML file stating the type and the Spring container uses that to instantiate them.

like:
<bean id="myCar" type="com.autos.Car" />

basically behind the scenes its doing:

Class myCarClass = new Class("com.autos.Car");
Object myCar = myCarClass.getInstance();

(or something similar, I can't remember exact syntax)

yay yayOG 2004

Syntax conforms to what I had seen. I really like how all the config files for a lot of the tools are in XML

deanh77 deanh77Founder

whoops, fixed to escape the html...

Welcome Back to eZabel

It's been a while. Here's what's new.

eZabel Lore

A complete history of our community — stats, Hall of Fame, legendary threads, and more.

View the Lore →

Everything Preserved

All 225,969 pieces of content from 2000–2014 are here — forums, messages, journals, photos, polls, and events.

💎

Gems

Spot something you love — a legendary comment, a classic thread, a great photo? Log in and click the diamond icon to mark it as a Gem. Add a note about why it's special. The best stuff surfaces on the Gems page.