+ 2
can we use cmd commands inside a java program?if yes then how?
in c++, you can clear the screen using clrscr() but i want to do the same in java too and for that I got runtime.getRuntime.exec("cls"); but it doesn't seem to work thats why i need help
1 Resposta
+ 2
'cls' is a shell command interpreted by cmd.exe (command.com for older systems); it is not itself executable.
To run these you have to execute the command interpreter first, which is blocked by Group Policy on SoloLearn.
* By the way; I see a lot of people (everywhere, not just here) trying to clear screens in subprocesses.
Just FYI, that doesn't make sense when a process is spawned just to do that (and then exits) -- it's not quite right.