Can I take a string that has a class name and create a new class from it? I can do this in C# but I have no idea how to do so with Java.
Name:
Anonymous2009-01-26 20:55
Okay I'm doing this:
Class.forName(somename).getConstructor().newInstance(x, y, somecustomclass);
but I'm getting back this:
java.lang.NoSuchMethodException: ((somename's contents, it's a valid class)).<init>()
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
There is a public constructor and it does accept those parameters, so I'm still lost(but hopefully really close).