Which statement clears the previous Graphics and draw a new One in Java?
<p>This is The Code :</p>

<pre><code>public void paint(Graphics g) {
    g.fillOval(x, y, 25, 25);

    repaint();

}
</code></pre>

<p>This will create an output like This where if i move the pointer it doesn't clear the previous Graphics and creates a Path .</p>

<p><a href="http://i.stack.imgur.com/3yJ5l.jpg" rel="nofollow">Output of Above Code</a></p>

<p>And by adding the super statement like this it Doesn't show the Path but only the Current location of the Oval Graphic.</p>

<pre><code>public void paint(Graphics g) {
    super.paint(g);
    g.fillOval(x, y, 25, 25);

    repaint();

}
</code></pre>

<p><a href="http://i.stack.imgur.com/Jdopp.jpg" rel="nofollow">The output is This</a></p>

<p>I just want to the Mechanism and The Reason Behind This.</p>