eclipse中出现这个问题,怎么解决?谢谢

解决方案 »

  1.   

    JDK版本不对拉...
    1.4没这个方法
      

  2.   

    代码是:
    import java.math.*;
    import java.util.*;public class BigInteger { public static void main(String[] args) {
    Scanner in = new Scanner (System.in);
    System.out.print("How many numbers do you want to draw?");
    int k = in.nextInt();
    System.out.print("what is the highest number can you draw?");
    int n = in.nextInt();
     BigInteger lotterOdds =  BigInteger.valueOf(1);
    for (int i=1;i<k;i++)
    lotterOdds = lotterOdds.multiply(BigInteger.valueOf(n-i+1)).divide(BigInteger.valueOf(i)); System.out.println("Your odds is 1 in "+lotterOdds+". Good luck!");
    }}报错是:
    没有为类型 BigInteger 定义方法 valueOf(int)
    没有为类型 BigInteger 定义方法 valueOf(int) at BigInteger.main(BigInteger.java:12)
    我的jdk是5.0的
      

  3.   

    把你的测试类名BigInteger为其他的,不要和jdk api中的类名一样。
      

  4.   

    谢谢,的确是类名与jdk中的类名一样导致的错误,谢谢