title: How to get a Class Object from the Class Name in Java
body: <p>I know the class name, say <strong>"MyClass"</strong> and want to retrieve the <code>Class</code> object, ie. <strong>MyClass.class</strong> for future references. Is there a way to do that?</p>
  
  <p>I've looked through the web but most of the things I found related to it were about the <code>ClassLoader</code>, which I presume are not suitable for my case. I do not want to initialize a class, but only get a class object for future uses.</p>
  
  <p>EDIT: Regarding the first answers to this:</p>
  
  <p>I've already checked the <code>forName()</code> method but I thought that is supposed to also initialize the class. Now I can call it with the full arguments and pass <code>false</code> to the second argument, but would the third have to be <code>null</code> or what?</p>
  
  <p>Would</p>
  
  <pre><code>Class.forName("MyClass", false, null);
  </code></pre>
  
  <p>return <code>MyClass.class</code>?</p>
  
  <p>In fact, what I want to do, is replace an array of String IDs associated with <code>Class</code> objects, with an array of IDs from which the class objects are fetched automatically, to get rid of some manual work :)</p>
  
  <p>Thanks for the quick answers and sorry for not mentioning this before.</p>