participation activity 6.3.1: input/output string streams. 1) declare and initialize a scanner variable…

participation activity 6.3.1: input/output string streams. 1) declare and initialize a scanner variable named inss that creates an input string stream using the string variable mystrline. 2) declare and initialize a printwriter variable named outss that creates an output string stream using the underlying stream given by stringwriter simplestream = new stringwriter(); 3) write a statement that copies the contents of an output string stream to an existing string variable called mystr. assume the stringwriter and printwriter variables are called simplestream and outss respectively.

participation activity 6.3.1: input/output string streams. 1) declare and initialize a scanner variable named inss that creates an input string stream using the string variable mystrline. 2) declare and initialize a printwriter variable named outss that creates an output string stream using the underlying stream given by stringwriter simplestream = new stringwriter(); 3) write a statement that copies the contents of an output string stream to an existing string variable called mystr. assume the stringwriter and printwriter variables are called simplestream and outss respectively.

Answer

  1. Scanner inSS = new Scanner(myStrLine);
  2. PrintWriter outSS = new PrintWriter(simpleStream);
  3. myStr = simpleStream.toString();