when i give System.out.println(args);//ToArgs is the name of the prog. in my code i get some wierd results during my interpretation..... ie. the compile works fine....the interpretation gives me.... d:\>java ToArgs [Ljava.lang.String;@273dc3 does any one know what that output means? good luck, ak.
Remember the argument to main method is an array of Strings. When you try print an array as such, that is output you get. (it calls Object's toString()) If you want to print all entries try printing them one by one: for(int i=0;i<args.length;i++)> System.out.println(args[i]);
The @273dc3 is the address of the array args. Marilyn
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Joined: Nov 22, 2008
What if i want to put a condition check on the args. passed. ie. Say if a persson passes arguments then print them else say no args. passed eg. if (args==true) print(args, args); etc. else print(No args passed); something likethe pseudocode eg. shown above. ak.