I need help with this Java Problem as described in the image below: import java.util.Scanner; import java.io.PrintWriter; import java.io.StringWriter; public class StringStreamOutput { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); String userItem; StringWriter itemCharStream = new StringWriter(); PrintWriter itemsOSS = new PrintWriter(itemCharStream); System.out.println("Enter items (type Exit to quit):"); userItem = scnr.next(); while (!userItem.equals("Exit")) { /* Your solution goes here */ userItem = scnr.next(); } userItem = itemCharStream.toString(); System.out.println(userItem); } }
I need help with this Java Problem as described in the image below:
import java.util.Scanner;
import java.io.PrintWriter;
import java.io.StringWriter;
public class StringStreamOutput {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
String userItem;
StringWriter itemCharStream = new StringWriter();
PrintWriter itemsOSS = new PrintWriter(itemCharStream);
System.out.println("Enter items (type Exit to quit):");
userItem = scnr.next();
while (!userItem.equals("Exit")) {
/* Your solution goes here */
userItem = scnr.next();
}
userItem = itemCharStream.toString();
System.out.println(userItem);
}
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images