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
- junit
- 여러인수
- C
- 자료구조
- 디자인패턴
- @Spring
- 10844
- 전치행렬 #C
- setParameter
- 점세개
- mycp
- 쉬운 계단 수
- BubbleSorting
- decorator
- designpattern
- NamedParameterNotBound
- gradle
- Spring
- @NotEmpty
- 데코레이터패턴
- java
- 10951
- Linux
- 백준
- pscp
- springboot
- 자바
- 숫자야구
- @ModelAttribute
- createQuery
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