Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Instance name from string

Name: Anonymous 2011-01-20 17:00

Guys, I've been looking what feels like everywhere for an answer to this java.reflection problem.

I want to use the contents of a string to create and instance of an object that has the name of what the string stores.

Eg.
String[] carName = {"volvo","vw","bmw"};

car carName[0];
car carName[1];
car carName[2];

Name: Anonymous 2011-01-20 17:42

>>9
This looks promising but returns
"Unhandled exception type ClassNotFoundException"

[And no, I didn't forget to define the class, if I hadn't it would return
"Cannot find a class or type named "Car""]

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List