Why create a new instance of Main?

I see many code samples posted that create a new instance of Main, but none of them seem to use it. But yet the Netbeans IDE won't seem to run without it. What is it for? How can it be utilized? How can it be nullified if it's not needed?
[247 byte] By [aussiecanuck46a] at [2007-10-2 14:26:14]
# 1
Are you asking why netbeans creates the Main class when doing a swing project? didn't get what u askedJubs
--jubs--a at 2007-7-13 12:46:09 > top of Java-index,Java Essentials,New To Java...
# 2
Yes, that's a fair interpretation of my question. Why would Netbeans, or other IDE's, create a new instance of Main? Common logic says that there can only be one Main. More than one creates confusion.
aussiecanuck46a at 2007-7-13 12:46:09 > top of Java-index,Java Essentials,New To Java...
# 3
forget common logic... Its just used to instantiate your Jframe extending class and passit to a EventQueue class. There is an option for not creating the main class.
--jubs--a at 2007-7-13 12:46:09 > top of Java-index,Java Essentials,New To Java...
# 4

> Yes, that's a fair interpretation of my question. Why

> would Netbeans, or other IDE's, create a new instance

> of Main? Common logic says that there can only be one

> Main. More than one creates confusion.

There can only be one main(String[] args) per class, but there's nothing which says that there can't be one main method in each class. I usually uses main methods to show example code, or to have some code which performs some kind of tests.

Kaj

kajbja at 2007-7-13 12:46:09 > top of Java-index,Java Essentials,New To Java...