Online Java Compiler By
JavaTpoint.com
import java.math.BigDecimal; public class BigDecimalEqualsExample4 { public static void main(String[] args) { // Create BigDecimal objects BigDecimal bdValue_1, bdValue_2; //Assigning Values into BigDecimal objects bdValue_1 = new BigDecimal("6587.390"); bdValue_2 = new BigDecimal("6587.390"); if(bdValue_1.equals(bdValue_2) ) { // Displaying message if both objects are same System.out.println( " These two BigDecimal objects are Same (True)"); } else { // Displaying message if both objects are not same System.out.println("These two BigDecimal objects are Not Same (False) "); } } }
Output