2 methods with same name Question
import javax.swing.*;
public class Duplicate {
/**
* @param args
*/
public static void methd(){
javax.swing.JOptionPane.showMessageDialog(null, "How I wonder what you are");
}
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "Twinkle Twinkle Little Star");
methd ();
}
public static void main() {
javax.swing.JOptionPane.showMessageDialog(null, "How I wonder what you are");
}
}
Why does the program compiles without errors despite the fact that it contains two methods with the same name main?