title: What is the difference between a.getClass() and A.class in Java?
body: <p>In Java what pros/cons exist surrounding the choice to use <code>a.getClass()</code> or <code>A.class</code>? Either can be used wherever a <code>Class&lt;?&gt;</code> is expected, but I imagine that there would be performance or other subtle benefits to using both in different circumstances (just like there are with <code>Class.forName()</code> and <code>ClassLoader.loadClass()</code>.</p>