title: how to pass string arguments in java as argument at runtime
body: <p>I am new to Java I need help with as how can I take values at runtime when a Java file is executed. I have Java program where the values of host,user, password and command is hardcoded, how can I parmeterize it.
  eg,</p>
  
  <pre><code>    public static void main(String[] args) {
          String host="ssh.journaldev.com";
          String user="sshuser";
          String password="sshpwd";
          String command1="ls -ltr";
          try{....
  </code></pre>
  
  <p>Can we make any changes such that at runtime on cmdline i can pass all values.
  eg.<br>
  <code>java -jar testjava ssh.journaldev.com sshuser sshpwd "ls -ltr"</code>
  this should be executed.</p>