static vs. non static
800326Mar 4 2009 — edited Mar 6 2009I'm writing a standalone java application. in main method, I need to call a method in another class like"
{code}pulic static void main(){
AClass.call();
}{code}
or
{code}pulic static void main(){
AClass a = new AClass();
a.call();
}{code}
should I make call() in AClass static?
in my situation, there is only one AClass instance needed here, but I do not need to restrict that there is only 1 instance of AClass cross whole application -- this is not required.
So, seems making call() static or non-static, both should work in this situation.
Is there any suggestion what would be good? static vs. non static ?
Thanks