J2SE Question, constructor auto run?
<p>I have wrote C# few years and start to learn java,
today i saw a sample is strange ,which is cannot happen in C#.
<br/>
from
<a href="http://www.java2s.com/Tutorial/Java/0261%5F%5F2D-Graphics/Drawrectangles.htm" rel="nofollow">http://www.java2s.com/Tutorial/Java/0261%5F%5F2D-Graphics/Drawrectangles.htm</a></p>

<pre><code>public class MainClass extends JFrame {

  public static void main(String[] a){
    MainClass f = new MainClass();
    f.setSize(300,300);
    f.setVisible(true);
  }


  public void paint(Graphics g) {
    g.drawRect(10, 10, 60, 50);
    g.fillRect(100, 10, 60, 50);
    g.drawRoundRect(190, 10, 60, 50, 15, 15);
    g.fillRoundRect(70, 90, 140, 100, 30, 40);
  }
}
</code></pre>

<p>the constructor paint() will be fire on main(), and the parameter - "g" haven't initialize anythings, is it a hidden feature on java but which is not legal on OOP ?</p>
