The java command-line argument is a parameter that is passed to the java program when it is run. The arguments…