title: How to access a static method via a class reference
body: <pre><code>class A {
      public static void foo() {}
  }
  
  class B {
      public static void foo() {}
  }
  </code></pre>
  
  <p>I have <code>Class clazz = A.class; or B.class</code>;</p>
  
  <p>How do I access this via "clazz" assuming it might be assigned either 'A' or 'B'</p>