Basic problems of Java
•
Java
public static void main( String arg[] )
public static void main( String arg[] )
In the above statement, can I use int array instead of string array? What happens if I don't put anything in parentheses, that is, if I use empty parentheses?
Solution
I'm not sure what int array means, but no, you can't The method signature must exactly match the public static void main (string [] args) The only thing you can change is the name of the parameter Method name, parameter type, visibility (public and private, etc.) are the contents used by the runtime to find the method itself If it does not match the signature, it is not an entry point method and will not be called when the application starts
However, it should be noted that what you suggest will compile without problems There will be no problems until you try to run the application
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码