Hello, What is the difference between: parseLong() and valueOf() ? For example:
String x = "1";

        long y = Long.parseLong(x);
        long z = Long.valueOf(x);

        System.out.println(y + "\n" + z);
During this task I got confused, and finally I previewed solutions on how to apply this BigInteger. Now my code looks like this:
BigInteger result = BigInteger.ONE;

        if (n < 0) {
            return "0";
        } else if (n == 0) {
            return "1";
        } else if (n > 0 && n <= 150) {
            int a = 1;
            for (int i = 1; i <= n; i++) {

                result = result.multiply((BigInteger.valueOf(i)));
                //System.out.println(result);  // check step by step
            }
        }
        return String.valueOf(result);