java Application 23 * 2
public static void main(String[] args){
System.out.println(args.length);
}
output: 7
why?
java Application 23 * 2
public static void main(String[] args){
System.out.println(args.length);
}
output: 7
why?
On Windows, you would get what you're expecting.
On Linux, the command shell is applying wildcard expansion, replacing the *
with names of all the files in the current directory.
To prevent wildcard expansion, quote the parameter (from Stop shell wildcard character expansion?):
java Application 23 '*' 2