title: Command-line arguments using NetBeans
body: <p>Right click on the project (console/desktop applications that use the <code>main()</code> method as an entry point), select the <em>properties</em> option from the sub-menu, select the <em>Run</em> node, a dialog looking like the <a href="https://i.stack.imgur.com/IGUA8.png" rel="nofollow noreferrer">following</a> will appear.</p>
  
  <p><img src="https://i.stack.imgur.com/IGUA8.png" alt="enter image description here"></p>
  
  <p>Command line arguments can be set in the <em>Arguments</em> box as a space separated list of values. These values are received by the only argument of the <code>main()</code> method as an array of Strings.</p>
  
  <p>So, the following program iterates through these values and displays numbers from 1 through 5.</p>
  
  <pre><code>public final class Main {
  
      public static void main(String[] args) {
  
          for (String arg : args) {
              System.out.println(arg);
          }
      }
  }
  </code></pre>
  
  <p>These values in this case, can only statically be set and cannot be changed dynamically.</p>
  
  <p>Can these values be fed dynamically to the program (probably through an IO device like the console) so that a user can supply values dynamically as we can do directly through a command-line without using an IDE?</p>
  
  <p>My current environment is :</p>
  
  <ul>
  <li>NetBeans 8.0.1</li>
  <li>JDK 8u25</li>
  </ul>