James Watson
Posts: 2024
Nickname: watson
Registered: Sep, 2005
|
|
Re: TIJ e2 ch2 ex7 question
|
Posted: Feb 23, 2011 7:01 AM
|
|
You are still too complex:
public class co2ex7 {
public static void main(String[] args) {
for (int i = 0; i < args.length && i < 3; i++){
System.out.println(args[i]);
}
}
}
I'm guessing that since the question specifically said 3 arguments, the following was the acceptable solution:
public class co2ex7 {
public static void main(String[] args) {
for (int i = 0; i < 3; i++){
System.out.println(args[i]);
}
}
}
Your solution is ahead of the book, I think. Is it too hard for someone who knows nothing of arrays? Well, now you know about arrays, right? It's a pretty important and basic thing to learn.
|
|