title: adding 2 BigDecimal values
body: <pre><code>class Point {
  
    BigDecimal x;
    BigDecimal y;
  
    Point(double px, double py) {
      x = new BigDecimal(px);
      y = new BigDecimal(py);
    }
  
    void addFiveToCoordinate(String what) {
      if (what.equals("x")) {
        BigDecimal z = new BigDecimal(5);
        x.add(z);
      }
    }
  
    void show() {
      System.out.print("\nx: " + getX() + "\ny: " + getY());
    }
  
    public BigDecimal getX() {
      return x;
    }
  
    public BigDecimal getY() {
      return y;
    }
  
    public static void main(String[] args) {
      Point p = new Point(1.0, 1.0);
      p.addFiveToCoordinate("x");
      p.show();
    }
  }
  </code></pre>
  
  <p>Ok, I would like to add 2 BigDecimal values. I'm using constructor with doubles(cause I think that it's possible - there is a option in documentation). If I use it in main class, I get this:</p>
  
  <pre><code>x: 1
  y: 1
  </code></pre>
  
  <p>When I use System.out.print to show my z variable i get this:</p>
  
  <pre><code>z: 5
  </code></pre>