You can do it on your own in ten minutes, surely? I shall make an executive decision that your app is supposed to take successive words from a Scanner reading from System.in, using a loop terminating when the input is “opstay”, and translate the input to pig‑Latin. I don't know what you are supposed to do with words starting with vowels.
Charles Byron wrote:. . . Maybe we can collaborate to get this code working?
I did say, “for the same JVM.” Of course a new JVM will have a new Stream instance represented by System.in.
Junilu Lacar wrote:. . . affect your ability to use Scanner(System.in) in a subsequent run. . . . closing System.in while the program is still running in the same JVM will have that effect . . .