J
J
Jake Taylor2020-06-24 20:54:33
Java
Jake Taylor, 2020-06-24 20:54:33

How to add text to the output stream?

How to make it so that the desired text is already displayed on the keyboard input sentence?

System.out.print("Ваш ввод: ");
String value = new Scanner(System.in).nextLine();

At the output, we have:
Ваш ввод:

How to make the stream already contain the desired text, for example, "TEXT", so that it looks like this in the console:
Ваш ввод: ТЕКСТ
And it would be possible to erase the "TEXT" or add something necessary and by pressing the Enter key everything was transferred to the variable value .

SOLUTION:
It is impossible to implement using standard Java tools.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-06-24
@firedragon

In sharps, this is done by Console.GetCursor, I'm sure that Java has the same thing. Both reading the current cursor position and moving the cursor to the desired position

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question