"자바 Press any key to continue..."의 두 판 사이의 차이

(새 문서: ==개요== ;자바 Press any key to continue... <syntaxhighlight lang='console'> import java.io.IOException; public class Main { public static void main(String[] args) {...)
 
 
(같은 사용자의 중간 판 하나는 보이지 않습니다)
2번째 줄: 2번째 줄:
;자바 Press any key to continue...
;자바 Press any key to continue...


<syntaxhighlight lang='console'>
<syntaxhighlight lang='java'>
import java.io.IOException;
import java.io.IOException;


20번째 줄: 20번째 줄:
}
}
</syntaxhighlight>
</syntaxhighlight>


==같이 보기==
==같이 보기==
* [[자바 Press Enter to continue...]]
* [[자바 Press Enter to continue...]]
* [[Java 콘솔 키 리더]]
* [[Press any key to continue...]]
* [[Press any key to continue...]]


[[분류: Java]]
[[분류: Java]]

2021년 10월 17일 (일) 12:33 기준 최신판

1 개요[ | ]

자바 Press any key to continue...
import java.io.IOException;

public class Main {
    public static void main(String[] args) {
        pressAnyKeyToContinue();
    }

    private static void pressAnyKeyToContinue() {
        System.out.println("Press any key to continue...");
        try {
            new ProcessBuilder("cmd", "/c", "pause > null").inheritIO().start().waitFor();
        } catch (InterruptedException | IOException e) {
            e.printStackTrace();
        }
    }
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}