Program #1: Java example program to open notepad
- package interestingJavaprograms;
- import java.io.IOException;
- public class NotepadJava {
- /**
- * @ www.corejavawithselenium.blogspot.in
- * @ how to open a new notepad using java program
- */
- public static void main(String[] args) {
- Runtime rt = Runtime.getRuntime();
- try {
- rt.exec("notepad");
- }
- catch (IOException ex) {
- System.out.println(ex);
- }
- }
- }