I don't really know what to do on TEST... Can anyone tell me why this would be wrong?

public class Main {
    /**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    for(String arg : args){
        int argInt = Integer.parseInt(arg);
        if(argInt == 42){
            break;
        }
            System.out.println(argInt);
    }
}
}

It do generate the output needed

  • created

    May '10
  • last reply

    May '10
  • 1

    reply

  • 175

    views

  • 2

    users

The input comes from System.in not via args[]

Check the other solutions carefully.

Suggested Topics

Want to read more? Browse other topics in JAVA based languages or view latest topics.