hai..kanasu here. i have doubt in access specifier. if iam using "public void yyy(int[]args)"instead of "public static void main(String args[])" i ll get run time error. in my whole program i am using only integers. then how can i give string []args?
when i should use string[]args and int[]args?
Collapse
X
-
First of all, whether you need it or not, you will have declare main as
Code:public static void main(String []args)
example:
Code:${JAVA_HOME}/bin/java your.package.TheClass value_1 valu_2
Code:args[0] = value_1 args[1] = value_2
example:
Code:Integer.parseInt(args[0]);
Comment