6.3.1 input output string streams

odt

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

145 X6485

Subject

Computer Science

Date

Dec 6, 2023

Type

odt

Pages

1

Uploaded by Ryanjordanl

Report
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. Scanner InSS = new Scanner(myStrLine), m Show answer 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(); PrintWriter outSS = new PrintWriter(simpleStream); 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. myStr= simpleStream.tostring(); , B3 oo Correct Scanner inSS = new Scanner(myStrLine); er class allows a programmer to create an m a String ring stream Correct PrintWriter outSS = new PrintWriter(simpleStream); takes in a StringWriter variable as a ent in order to create an output string that allows 2 programmer to write various data ctor argum Correct () method returns a copy of the the output string streamis buffer Feedback?
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help