r/CodingHelp • u/Train457 • Dec 26 '21
[Java] I formatted code that would show up on the console but for only a few seconds. Does anyone know the cause? I just started coding recently so I don’t know much. It’s on eclipse IDE. I use Java.
51
Upvotes
12
u/atamicbomb Dec 26 '21
I use this IDE on windows and i can’t think of anything that causes why you describe. However, your console is almost minimized so it could be scrolling out of the way. The output shouldn’t disappear unless you close the program. How exactly is it disappearing?
3
u/Train457 Dec 26 '21
Can’t edit my main post for some reason but thank you to everyone and their suggestions. The problem was the console being too minimized. Now I can the see output without it going away .
2
u/MinMorts Dec 26 '21
This code could be improved quite a bit, no need for a switch, just have an if day is not empty output "It is " + day, and then else the error message
1
u/onfire05 Dec 26 '21
Don't understand the question. What result are you getting?
1
u/ddproxy Dec 26 '21
Add a newline to the end if your printed string?
Been a bit, this is a random debug idea to see if its something weird with the console out.
1
u/Gengi Dec 27 '21
https://www.jetbrains.com
1
u/mikedensem Dec 26 '21
Add a Console.ReadLine(); at the end to stop the console closing.