
Scanner에서 입력값을 받을 때 next() (nextInt(), nextDouble()) 와 nextLine()이 있는데 이 둘 메소드는 비슷하면서도 차이점이 있다. next()구분자 : 공백(white space), tab(\t), 개행문자(Enter)(\n)문자열 내에 구분자는 포함되지 않는다.nextLine()구분자 : 개행문자(Enter)(\n) 문자열 내에 개행문자가 포함된다. 개행문자가 포함되는지 않되는지를 잘 구분해야 아래와 같은 오류를 피할 수 있다.import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); ..