title: Java: replaceAll doesn't work as I think it should
body: <pre><code>public class NewClass {
      public static void main(String[] args) {
              String piece = "10*2";
              String ans = "20";
              String problm = "10*2*9";
  
              System.out.println(piece);
              System.out.println(ans);
  
              problm.replaceAll(piece, ans);
  
              System.out.println(problm);
      }
  }
  </code></pre>
  
  <p>This is my code, and when  I print <code>problm</code> it prints: <code>10*2*9</code>
  I want it to print <code>20*9</code>, please tell me what I'm doing wrong</p>