logo

Multiply two BigDecimal values

Java Code Examples for java.math.BigDecimal.multiply()

This method to multiply two BigDecimal values.

package simplesolution.dev;

import java.math.BigDecimal;

public class BigDecimalMultiplyExamples {

    public static void main(String... args) {
        BigDecimal bigDecimal1 = new BigDecimal("30.01");
        BigDecimal bigDecimal2 = new BigDecimal("10.2");

        BigDecimal result = bigDecimal1.multiply(bigDecimal2);

        System.out.println(bigDecimal1);
        System.out.println(bigDecimal2);
        System.out.println(result);
    }
}

Happy Coding 😊

Tags: