title: error: multiply(long) is not public in BigInteger; cannot be accessed from outside package
body: <p>I'm trying to write a Java method that uses counts the number of ways to sequentially order n distinct objects - a permutation. Every time I try to complile my code, I get an error saying:</p>
  
  <blockquote>
    <p>multiply(long) is not public in BigInteger; cannot be accessed from outside package.</p>
  </blockquote>
  
  <p>I tried replacing the line <code>fact = fact.multiply(i);</code> with <code>fact = fact.multiply((long) i);</code> which didn't work either. Does anyone have any ideas?</p>
  
  <pre><code>import java.math.BigInteger;
  
  public class Combinatorics  {
  
      public static void main(String[] args) {
          // 2.1
         System.out.println(CountPerm(9));
  
      }
  
      public static BigInteger CountPerm(int n) {
          BigInteger fact = BigInteger.valueOf((long) 1);
          for(int i = 1; i &lt;= n; i++){
              fact = fact.multiply(i);
          }
          return fact;
      }
  }
  </code></pre>