title: pass bigdecimal numbers in java
body: <p>I want to pass value to a method using big decimal number but my program shows compiler errors.</p>
  
  <pre><code>package com.khalidFarik;
  
  import java.math.BigDecimal;
  
  public class Main {
      public static void main(String[] args) {
          checknumbersinDecimals(12.3,12.2);
      }
  
      public static void checknumbersinDecimals(BigDecimal payment1,BigDecimal payment2){
          payment1 = new BigDecimal("1230.23");
          payment2 = new BigDecimal("1230.23");
          BigDecimal number3= payment1.subtract(payment2);
          System.out.println(number3.toString());
      }
  }
  </code></pre>
  
  <p>How can I pass the big decimal number to my method <code>checknumbersinDecimals()</code> in the main method?</p>