Hi,
now, i guess i have to post my full code.. I have tried everything.. i just
don't know why i cant get the args[0] to print..
here is the full code :
public class BuiltInClass {
public static void main(String[] args) { if(args.length!=5){
System.out.println("please, names must be 5 on command line!!");
System.exit(0); } for(int i = 0; i<args.length;i++){ //just
to be sure i have the right number of names
System.out.println(args[i]+ " "); } String []arr = new
String[args.length]; for(int i = 0; i<args.length;i++){ arr[i]
= args[i];} for(int i = 1; i<arr.length;i++){//here i couldnt print out
the name in args[0] System.out.println(arr[i]+ " ");}
generateNewName(arr);
}
//the static method to generate the names public static void
generateNewName(String[] arr){ String name1 = arr[1]; String
name2 = arr[2]; String name3 = arr[3]; String name4 = arr[4];
String name5 = arr[5];
char a = name1.charAt(1); System.out.println(a + " ");
char b = name2.charAt(1); System.out.println(b + " "); char c =
name3.charAt(1); System.out.println(c+ " "); char d =
name4.charAt(1); System.out.println(d + " "); char e =
name5.charAt(1); System.out.println(e + " ");
}
}
I just do not know why i cannot transfer the args[0] to the arr[0]
Dont look at where you fell but where you slipped!!!
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en