title: Why don't I need to create an object?
body: <pre><code>import javax.swing.JoptionPane;
  
  class Hat
  {
    public static void main(String[]args)
     {
  
        String fn = JOptionPane.showInputDialog("Enter first number");
        String sn = JOptionPane.showInputDialog("Enter second number");
  
        int num1 = Integer.parseInt(fn);
  
        int num2 = Integer.parseInt(sn);
  
        int sum = num1 + num2;
  
        JOptionPane.showMessageDialog(null,"The answer is " +sum,"the title");
     }
  }
  </code></pre>
  
  <p>Why is it not necessary to create an object in order to use showInputDialog method from the JOptionPane class?
  Why is null used in showMessageDialog method?</p>