I want to replace a entire String with new value using String replaceAll method in Java
<pre><code>String x = "Welcome to Java World";
System.out.println(x.replaceAll(".*","JAVA"));
Actual Output = "JAVAJAVA" .
Excepted Output = "JAVA".
</code></pre>

<p>Can anybody help why it replace like this . ".*" all characters in a original string and replace this with "JAVA" . Why this returns "JAVAJAVA" .</p>
