Scanner
1 | 표준입력 클래스인 Scanner에 대해서 정리해두자. |
Scanner 인스턴스 생성
1 |
|
int <- scanner.nextInt()
1 |
|
int[] <- scanner.nextInt()
1 |
|
double <- scanner.nextDouble()
1 |
|
double[] <- scanner.nextDouble()
1 |
|
char <- scanner.next().charAt(0)
1 |
|
char[] <- scanner.nextLine().toCharArray()
1 |
|
String <- scanner.nextLine()
1 |
|
String[] <- scanner.next()
1 |
|