title: Can setDefaultCloseOperation work without specifying any object?
body: <p>I came across a code which calls setdefaultcloseoperation() without reference to any object. I read that methods are called with reference to object. Here is the code </p>
  
  <pre><code>public class Mainpage extends JFrame implements ActionListener{
      JFrame f = new JFrame("Mainpage");
  
      public Mainpage() {
          super("Mainpage");
          f.setSize(1000,6000);
          f.getContentPane().setLayout(null);
          f.setVisible(true);
          setDefaultCloseOperation(EXIT_ON_CLOSE); // how is this happening?
  }
  </code></pre>
  
  <p>I want to know how <code>setDefaultCloseOperation(EXIT_ON_CLOSE);</code> is working. Thanks.</p>