BigInteger valueOf方法找不到符号

Emr*_*lün -2 java biginteger value-of

我创建了一个包含BigInteger对象的数组.当我想为数组分配数字时,我得到一个找不到符号的错误.你能帮助我吗?那是代码:

import java.io.*;
import java.util.*;
import java.math.BigInteger;

public class Solution
{
    public static void main(String[] args) 
    {
        Scanner in = new Scanner(System.in);
        int t1= in.nextInt();
        int t2= in.nextInt();
        int n= in.nextInt();

        BigInteger[] arr = new BigInteger[n];
        arr[0] = new BigInteger.valueOf(t1);
        arr[1] = new BigInteger.valueOf(t2);

    }
}
Run Code Online (Sandbox Code Playgroud)

输入值为0 1 5.这是错误:

Solution.java:15: error: cannot find symbol
        arr[0] = new BigInteger.valueOf(t1);
                               ^
  symbol:   class valueOf
  location: class BigInteger
Solution.java:16: error: cannot find symbol
        arr[1] = new BigInteger.valueOf(t2);
                               ^
  symbol:   class valueOf
  location: class BigInteger
2 errors
Run Code Online (Sandbox Code Playgroud)

Rei*_*eus 8

valueOf 是一种静态方法

arr[0] = BigInteger.valueOf(t1);
Run Code Online (Sandbox Code Playgroud)