Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.math.BigInteger;

public class Main {
    public static void main(String[] argv) throws Exception {
        // Create via a string
        BigInteger bi1 = new BigInteger("1234567890123456890");

        // Create via a long
        BigInteger bi2 = BigInteger.valueOf(123L);

        bi1 = bi1.add(bi2);
        bi1 = bi1.multiply(bi2);
        bi1 = bi1.subtract(bi2);
        bi1 = bi1.divide(bi2);
        bi1 = bi1.negate();
        int exponent = 2;
        bi1 = bi1.pow(exponent);

    }
}