Calling a method in java
<pre><code>public class DialogBox {
    public static void main (String arg[]) {
        String inputCourseCode;
        inputCourseCode = this.inputCourseCode();
    }
    public String inputCourseCode() {
        String input = JOptionPane.showInputDialog("Input the course code of this course:");
        return input;
    }
}
</code></pre>

<p>How to call the method <code>inputCourseCode</code> in main function?</p>
