QUESTION:NOTEPAD OPENING USING JAVA:
Here we use ProcessBuilder class and create its object following is a simple program opening notepad using java.
import java.io.*;
import java.util.*;
class notepad
{
public static void main(String args[])
{
try
{
ProcessBuilder proc=new ProcessBuilder("notepad.exe","report");
proc.start();
}
catch (Exception e)
{
System.out.println("notepad not open");
}
}
}
No comments:
Post a Comment