title: scala override static java method
body: <p>I am trying to use Webgraph <a href="http://webgraph.di.unimi.it/" rel="nofollow">http://webgraph.di.unimi.it/</a> framework in Scala. Here exists some posibility to customize Loader classes. This customization was made via reflection.</p>
  
  <pre><code>...
  graphClass = Class.forName( graphClassName ); // graphClassName string name of class 
  graph = (ImmutableGraph)graphClass.getMethod( "load", classOf[CharSequence] ).invoke( null, is );
  ...
  </code></pre>
  
  <p>in java "load" is static method of class , but how can i write this method on scala to allow my code work ? 
  I have tried </p>
  
  <pre><code>class MyLoader {
     def load(filename:CharSequence ) =  ...
  }
  </code></pre>
  
  <p>or even</p>
  
  <pre><code>object MyLoader {
     def load(filename:CharSequence ) =  ...
  }
  </code></pre>
  
  <p>with graphClassName = "MyLoader$" </p>
  
  <p>but without success.</p>
  
  <p>Known and working solution is to write the bridge Java class , but it is interesting if exists some "legal" way to do this.</p>
  
  <pre><code>//     MyLoader.java
  
  public class MyLoader {
  
      public static ImmutableGraph load( CharSequence basename ) throws IOException {
          return new ScalaMyLoader(basename);
      }
  
  }
  </code></pre>