public class VirusLook {
public static void main(String[] arguments) {
int numViruses = Integer.parseInt(arguments[ 0] );
if (numViruses > 0) {
Virus[] virii = new Virus[ numViruses];
for (int i = 0; i < numViruses; i++) {
virii[ i] = new Virus();
}
System.out.println("There are " + Virus.getVirusCount()
+ " viruses.");
}
}
}
1. Please use code tags like you were told in the first reply!
2. As atmguy told you from your error message you have an array index problem on line 3. The only place you are accessing an array on that line is: "arguments[0]". Therefore arguments must be an empty array.
3. To correct either take out the code or pass an argument to the main method.