자바 Press any key to continue...

Jmnote (토론 | 기여)님의 2021년 10월 16일 (토) 19:48 판 (새 문서: ==개요== ;자바 Press any key to continue... <syntaxhighlight lang='console'> import java.io.IOException; public class Main { public static void main(String[] args) {...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

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 }}