title: how to get list of methods from .java file
body: <p>I have a path of a <code>.java</code> file in my Java program. I want to get the list of methods that are available in the <code>.java</code> file.</p>
  
  <p>For example,
  I have a <code>.java</code> file at 'C:\temp\Foo.java' as follows:</p>
  
  <pre><code>class Foo{
      public int add(int a, int b){ return a+b;}
      public int sub(int a, int b){ return a-b;}
  }
  </code></pre>
  
  <p>In my program, I want to get the method names <code>add</code> and <code>sub</code>.
  Is there any java api to achieve the same?
  I know that for <code>.class</code> file, we can achieve it using Reflection, but is it possible for <code>.java</code> file?</p>