Question: Java Project Draw a class diagram for the below class (using UML notation) import java.io.BufferedReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; public class myData {

Java Project

Draw a class diagram for the below class (using UML notation)

Java Project Draw a class diagram for the below class (using UML

import java.io.BufferedReader;

import java.io.FileWriter;

import java.io.IOException;

import java.io.InputStreamReader;

public class myData {

public static void main(String[] args) {

String str;

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

System.out.println("Enter text (stop to quit).");

try (FileWriter fw = new FileWriter("test.txt")) {

do {

System.out.print(": ");

str = br.readLine();

if (str.compareTo("stop") == 0)

break;

str = str + " "; // add newline

fw.write(str);

} while (str.compareTo("stop") != 0);

} catch (IOException exc) {

System.out.println("I/O Error: " + exc);

}

}

}

1eimport java.io.BufferedReader; 2 import java.io.FileWriter; 3 import java.io.IOException; 4 import java.io.InputStreamReader; 6 public class myData [ 7 public static void main (String[] args) { String str; BufferedReader br new BufferedReader (new InputStreamReader (System.in)); System.out.println("Enter text ( stop' to quit)."); try (FileWriter fw= new FileWriter ("test.txt")| 10 do t System.out.print(": "); str br . readLine ( ) ; if (str.compareTo ("stop") 15 16 0) break str = str + " ". // add newline fw.write (str) 19 } while (str.compareTo ("stop") != 0); catch (IOException exc) 21 System. out.println("I/O Error:"exc)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!