String java.util.Scanner.nextLine()

송병훈·2022년 3월 21일
0

method

목록 보기
2/13

String java.util.Scanner.nextLine()


현재 줄을 지나 이 스캐너를 진행하고 건너뛴 입력을 반환합니다.
이 메서드는 끝에 있는 줄 구분 기호를 제외한 현재 줄의 나머지 부분을 반환합니다. 위치는 다음 줄의 시작 부분으로 설정됩니다.

이 메서드는 줄 구분 기호를 찾는 입력을 계속 검색하므로 줄 구분 기호가 없는 경우 건너뛸 줄을 검색하는 모든 입력을 버퍼링할 수 있습니다.

반환값:
건너뛴 줄

예외:
NoSuchElementException - 행을 찾을 수 없는 경우
IllegalStateException - 이 스캐너가 닫혀 있는 경우


Advances this scanner past the current line and returns the input that was skipped. This method returns the rest of the current line, excluding any line separator at the end. The position is set to the beginning of the next line.

Since this method continues to search through the input looking for a line separator, it may buffer all of the input searching for the line to skip if no line separators are present.

Returns:
the line that was skipped

Throws:
NoSuchElementException - if no line was found
IllegalStateException - if this scanner is closed

profile
성실하고 꼼꼼하게

0개의 댓글