Java: PrintStream to String?

前端 未结 6 918
半阙折子戏
半阙折子戏 2021-01-30 15:10

I have a function that takes an object of a certain type, and a PrintStream to which to print, and outputs a representation of that object. How can I capture this f

6条回答
  •  遇见更好的自我
    2021-01-30 15:51

    Define and initialize a Scanner variable named inSS that creates an input string stream using the String variable myStrLine.

    Ans: Scanner inSS = new Scanner(myStrLine);

提交回复
热议问题