First of all, whether you need it or not, you will have declare main as
- public static void main(String []args)
this args is for setting data from command prompt.
example:
- ${JAVA_HOME}/bin/java your.package.TheClass value_1 valu_2
in your args:
-
args[0] = value_1
-
args[1] = value_2
-
if you want to pass numerical value, all you have to do is parse them.
example:
- Integer.parseInt(args[0]);