It is necessary to emulate input from the console, but not one value, but several. For one value, the following practice was applied:

System.setIn(new ByteArrayInputStream("...".getBytes())); System.setIn(System.in); 

How to do for multiple values ​​if possible?

  • and if the values ​​are separated by a newline, of the type "value1 \ nvalue2"? - zRrr
  • I tried to do so. Doesn't work - Vlady_32
  • A separator is not suitable? With the subsequent breakdown during processing? - Chubatiy
  • I just can not understand. How then you can transfer values ​​to the console in order. - Vlady_32

0