Hello.
I do not have time to view the contents. The console window closes immediately. How to leave it open?
What command java can stop the console window?
Hello.
I do not have time to view the contents. The console window closes immediately. How to leave it open?
What command java can stop the console window?
Try to run from the "command line" (Start> run> cmd.exe) ... If you are too lazy to type, write a simple bat file. In it after the lines with the launch of the compiler and the execution of the "main class" write pause.
Example bat file myrun.bat:
@echo on javac HelloWorld.java java -classpath . HelloWorld pause You can read about working with Java on the command line here: http://habrahabr.ru/post/125210/
I haven't written in Java for a long time, something like
int c = System.in.read(); will wait for keyboard input.
-
@ Aleksandr1111 , and what kind of IDE do you study? I remember in eclipse there were no such problems.
The window closes after the application is completed. You can use System.exit () to terminate an application anywhere.
system("pause"), getch() , everything is underlined in red, what namespace are they from? - Aleksandr1111Source: https://ru.stackoverflow.com/questions/386599/
All Articles