Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- @NotEmpty
- 자료구조
- Linux
- junit
- springboot
- mycp
- decorator
- createQuery
- 백준
- java
- C
- 점세개
- Spring
- 여러인수
- designpattern
- 전치행렬 #C
- BubbleSorting
- 디자인패턴
- 쉬운 계단 수
- @Spring
- pscp
- NamedParameterNotBound
- setParameter
- @ModelAttribute
- 10951
- 데코레이터패턴
- 10844
- 숫자야구
- gradle
- 자바
Archives
- Today
- Total
목록Scanner (1)
...

next() -> '토큰'의 개념으로서 문자열을 입력받는다. 따라서 앞뒤 공백이나 스페이스가 구분자로 인식되어 입력값으로 들어오지 않는다. import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s; while(sc.hasNext()) { s = sc.next(); System.out.println(s); } } } nextLine() -> nextLine()은 토큰 단위로 입력값을 받아오는 게 아닌 콘솔창의 한 문장을 간격으로 입력값을 받아온다. 따라서 앞뒤에 공백이 있거나 중간에 space가 있어도 이를 구분자로 사용하지 않..
언어/JAVA 자바
2022. 2. 18. 15:39