//Java program to run an application. import java.util.*; class OpenNotepad { public static void main(String[] args) { Runtime app = Runtime.getRuntime(); try { //open notepad app.exec("notepad"); //open calculator app.exec("calc"); } catch (Exception Ex) { System.out.println("Error: " + Ex.toString()); } } }
Output:
Notepad and Calculator will be opened.
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Run an application using Java program
Output: