11. Processes
Activity 1: Making a Parent Process to Launch a Child Process
Solution
- The child should have an algorithm that looks like the following:
Child.java
9Â Â Â Â Â public static void main(String[] args) throws java.io.IOException, InterruptedException { 10Â Â Â Â Â Â Â Â int ch; 11Â Â Â Â Â Â Â Â System.out.print ("Let's echo: "); 12Â Â Â Â Â Â Â Â while ((ch = System.in.read ()) != '\n') 13Â Â Â Â Â Â Â Â Â Â Â Â System.out.print ((char) ch); 14Â Â Â Â Â Â Â Â BufferedWriter bw=new BufferedWriter( 15Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â new FileWriter(new File("mycal2022.txt"))); 16Â Â Â Â Â Â Â Â Â Â Â Â int cont = 0; 17Â ...