I’m an University student and new to java. Last year, second semester we did some programming in C. I test a lot of stuff before truly understanding it. In C I only need to start with int main() to start coding. Java is a bit more confusing. Why, do I “need” (I’m not sure if I have to start this way) to start with
public static void main (String[] args)
if I’m not going to use the argument in my program. This:
public static void main ()
gives me an error. I don’t want to read in any arguments.
I hope you understand – English is not my Home Language.
It’s just language definition.
The signature:
Is the signature of the main method in Java, some languages have more than one main method signature.
You don’t need to worry if you don’t use the
argsarray, it will just stay empty.This wiki page could clear things up a bit.