Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {

    public static void main(String[] args) {
        try {
            // create a new process
            Process p = Runtime.getRuntime().exec("notepad.exe");

            p.destroy();

            System.out.println(p.exitValue());

        } catch (Exception ex) {
            ex.printStackTrace();
        }

    }
}