title: How to pass Scala command line arguments to a Java method?
body: <p>I have a piece of Scala code:</p>
  
  <pre><code>class A {
    def main(args: Array[String])
  }
  </code></pre>
  
  <p>Then a piece of Java code:</p>
  
  <pre><code>class B {
      public static int test(final String... args) {
          System.out.println("This is a test.");
          // Use the arguments
          ...
      }
  }
  </code></pre>
  
  <p>What I want is to call B.test within A.main like below:</p>
  
  <pre><code>class A {
    def main(args: Array[String]) = {
      val result = B.test(args)
    }
  }
  </code></pre>
  
  <p>The above code won't work because the types do not match. If somebody could provide an elegant solution it would be highly appreciated.</p>
  
  <p>Please only change the Scala part as the Java part will come from another lib. Thank you!</p>