• Post Reply Bookmark Topic Watch Topic
  • New Topic

Clearing the screen and reset()  RSS feed

 
Greg Ferguson
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone.

In the snippet of code below, I was wondering if there is a way to clear the screen of previous input if the user types 'y' to continue. I thought the reset() method would do it ... but apparently not. Could someone please explain what reset() is supposed do or point me in the right direction?

Thanks.

 
Junilu Lacar
Sheriff
Posts: 11477
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And just exactly is a "loop"? You didn't show its type declaration. See also, http://stackoverflow.com/questions/2979383/java-clear-the-console
 
Greg Ferguson
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:And just exactly is a "loop"? You didn't show its type declaration. See also, http://stackoverflow.com/questions/2979383/java-clear-the-console


This is what "loop" is: Scanner loop = new Scanner(System.in) but that's rather vague so here is a more relevant version of the code.



Although that solution didn't work, it seems the consensus is that clearing the console really can't be done without writing your own custom method, but thanks for pointing me in the right direction.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!