 <pre><code>return Class.forName(className); </code></pre> <p>regarding your edit, you cannot "cast" a string value to a long value. in order to convert a string value to some other type, then you need something more complex, like <a href="http://commons.apache.org/beanutils/api/org/apache/commons/beanutils/ConvertUtils.html" rel="nofollow">this</a>.</p>