args
is short from arguments
and purpose of that array is to hold values provided when we start Java application like
java YourClass argument0 argument1 argument2
You can change name of any method parameter (compiler doesn't save those names anyway so they are only present at .java
file, and are replaced by other values at .class
file) including args
, but I would leave it as. As someone said:
Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live.
so don't do unnecessary changes.
You can also remove that argument, but this way you will create your own separate method which will be called main
, but will no longer be entry point. This means you will not be able to run it directly via
java YourClass
command because JVM would be searching for public static void main(String[])
method in YourClass
but since your method will not fit this signature it wouldn't be treated as valid entry point.