Question: I am trying to get the user input using the following code but on running it gives the error that Arrayindexoutofbounds.
Don't know what is the problem.

```
public static void main(String[] args) {
    int T = Integer.parseInt(args[1]);
    PercolationStats stats = new PercolationStats(
            Integer.parseInt(args[0]), T);
    double mean = stats.mean();
    StdOut.println("mean = " + mean);
    double stddev = stats.stddev();
    StdOut.println("stddev = " + stddev);
    double d = (1.96 * stddev) / Math.sqrt(T);
    StdOut.println("95% confidence interval = " + (mean - d) + ", "
            + (mean + d));
}

```

Answer: 
To pass arguments to a Java program via Eclipse, you should use the **Arguments** tab in Run > Run Configurations. Example:

**Arguments**

![enter image description here](https://i.stack.imgur.com/J9JLU.png)

**Code**

```
public static void main(String[] args) {
    System.out.println(args[0]);
    System.out.println(args[1]);
    System.out.println(args[2]);
}

```

**Result**

```
33
twitter
400.23

```
you can pass your input parameters in following way in Eclipse:
click menu Run -> Run Configurations -> Arguments
in Program arguments put your arguments, which will be loaded to "String [] args"
you could just separate your arguments by space:

e.g.

1 2 3

and your args = {1,2,3}