Why does a method with the same name as the class not need a return type?
<p>Why is this legal?:</p>

<pre><code>public class TwoFrames extends JFrame {
    public TwoFrames() {
        return;
    };
}
</code></pre>

<p>And this isn't (NetBeans IDE saying <strong>invalid method declaration; return type required</strong>)?:</p>

<pre><code>public class TwoFrames extends JFrame {
    public firstFrame() {
        return;
    };
}
</code></pre>
