title: How to avoid methods inherited from Object class in Java when examining a class with reflection?
body: <p>Is there any way to avoid methods inherited from Object class.
  I have the following code :</p>
  
  <pre><code>public void testGetMethods() {
      SomeClass sc = new SomeClass();
      Class c = sc.getClass();
      Method [] methods = c.getMethods();
  
      for (Method method : methods) {
          System.out.println(method.getName());
      }
  }
  </code></pre>
  
  <p>All is okay but it also returns me methods from the Object class like hashCode, getClass, notify, equals, etc. The class SomeClass should just have two of its own methods which are m1 and m2.</p>
  
  <p>I want only these methods (m1, m2) printed. Is there any way I can achieve this?</p>