The ability to do this is a property of the terminal, not the language. So, in principle, if you are connected to a sufficiently capable terminal emulator, then yes, of course, this is possible.
The goal of a library such as ncurses is to abstract the details of the gore terminal-dependent cursor movement, etc. You do not need something like ncurses, you can always directly emit the appropriate codes for your target terminal.
By, "is there an equivalent method in Java," you mean, are there libraries that can also provide you with terminal-agnostic abstractions? Yes (see Other Answers). But nothing is going to turn every host system into a JVM for the VT100 emulator. For example, good luck on Windows. In this sense, 2D graphics in Java is more universal than a terminal environment!
source share