Hello,
I'm just wondering about static and non-static methods. I have a basic understand that non-static methods require a new object to be initialized to be used such as:
public static void main()
{
mainProgram main = new mainProgram();
main.doNothing();
}
public void doNothing()
{
}
]
V.S.
public static void main()
{
doNothing();
}
public static void doNothing()
{
}
]
But I don't understand the context in which they should be used. When should a static method be used over a non static method and vice versa?? I don't really see much of a difference and I have written programs in both methods but want to learn the "correct" way of utilizing these methods.