Life is an amazing experience to behold at times. Other times it can be a bit of a nightmare. I guess it all depends on the day, now doesn’t it? Yeah, something like that. Who knows what this life will bring about. I for one don’t know. That’s the big secret behind this life I suppose. But life doesn’t have to be mysterious. Trying to figure out how this life work sat times- can be a nightmare. However all is not lost if you can have hope in something that will make life that much better. If we constantly allow our own thoughts and feelings to fight against us, we will never be better than we currently are. It’s easier said than done naturally. I am my own worst enemy, my worst critic. That’s simply how this life treats me at times. Not much else to comment about that. Am I playing the victim or simply stating the facts? Who can say for sure? I personally feel I’m just telling it like it is, nothing more. Sometimes I can’t determine my own thoughts from that of psychosis . Parts o...
Sometimes when you're writing a program in Java you want to clear the screen. That is to remove all text from the screen.
Here's how we would do this in Java:
private void clearScreen() {
try {
if (System.getProperty("os.name").contains("Windows")) {
new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor();
} else {
new ProcessBuilder("clear").inheritIO().start().waitFor();
}
} catch (IOException | InterruptedException ex) {
ex.printStackTrace();
}
}
This takes into account both windows and non windows. cls for Windows, clear for linux etc.
Comments
Post a Comment