java - Why do I get an 'ArrayIndexOutOfBoundsException' error? -
java - Why do I get an 'ArrayIndexOutOfBoundsException' error? -
i'm new java programming.
can assist me next code:
class="snippet-code-html lang-html prettyprint-override">public class randomseq { public static void main(string[] args) { // command-line argument int n = integer.parseint(args[0]); // generate , print n numbers between 0 , 1 for (int = 0; < n; i++) { system.out.println(math.random()); } } }
i receive next error message when trying compile:
exception in thread "main" java.lang.arrayindexoutofboundsexception: 0
thank in advance.
[1] utilize 64-bit java 8 (update 25) se implementation, using 64-bit eclipse ide java developers (v. 4.4.1).
run-> run configurations->arguments->enter arguments separated space->apply->run
ensure right project name , it's main method selected under "the main" tab under run configurations
java
Comments
Post a Comment