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