title: call another class from java program
body: <p>I have 2 classes one is a simple one</p>
  
  <p>Sample.java</p>
  
  <pre><code>public class Sample {
    public static void main(String args[]) {
  
      System.out.println("Hello World!!!!!");
    }
  }
  </code></pre>
  
  <p>Other one is something like this</p>
  
  <p>Main.java</p>
  
  <pre><code>public class Main
  {  
    public static void main(String[] args) throws Exception
    {
       Runtime.getRuntime().exec("java Sample");
    }
  }
  </code></pre>
  
  <p>I am basically trying to run the Main.java program to call Sample.java in a new command prompt...that is a new cmd that should open and print the output of Sample.java...how should I do this...???</p>