View Single Post
Old Jul 23rd, 2006, 1:11 AM   #1
quantalfred
Newbie
 
Join Date: Jan 2005
Posts: 21
Rep Power: 0 quantalfred is on a distinguished road
Call the class main function

I define a class and write the main method without static. I can compile it. But in other class when I initiate one instance of that class (call it aa) and call aa.main(args); (with args the correct input type), I got an error "variable aa might not have been initialized.

I understand that main is called when it is executed. Then does that mean public static is the only way all the main functions can be, at least meaningfully?
quantalfred is offline   Reply With Quote