Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.math.BigDecimal;

public class Main {

    public static void main(String[] args) {

        BigDecimal bg1 = new BigDecimal("25.00");
        BigDecimal bg2 = new BigDecimal("25.00");
        BigDecimal bg3 = new BigDecimal("25");

        // assign the result of equals method to b1, b2
        Boolean b1 = bg1.equals(bg2);
        Boolean b2 = bg1.equals(bg3);

        System.out.println(b1);
        System.out.println(b2);
    }
}