I have noticed that there seems to be two styles of implementing the main method within a class. I have included the following code as a reference to my question.
Style A being the default approach and
Style B being a rather more preferred approach. I am curious as to what exactly is the difference between the two? What advantages does one have over the other?
//Style A
public static void main(String[] args) {
//Code...
}
//Style B
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
new myClass().methodName();
}
});
}