title: java equivalent of c# typeof()
body: <p>I'm very new to java. Say I've a xml parser and I'd create object from it. In c# i'd do like:</p>
  
  <pre><code>parser p = new parser(typeof(myTargetObjectType));
  </code></pre>
  
  <p>In my parser class I need to know which object I'm making, so that i can throw exception if parsing is not possible.
  How to Do the same in jave? I mean how I can take arguments like <code>typeof(myObject)</code></p>
  
  <hr>
  
  <p>I understand every language has it's own way of doing something. I'm asking what's way in java</p>