시간 분,초 문제

conan9123 Reply 6 years 33 weeks ago
Scanner sc = new Scanner(System.in); int number = sc.nextInt(); int hour, minute, second; Idea에서는 잘 나오던데 submit하니까 compile 에러가 뜨네요 ㅠㅠ 왜 그런건가요.... 그리고 Scanner sc 대신 Scanner input 차이와 sc.nextInt 대신 sc.nextDoulbe 쓰는 차이도 궁금합니다.
withcs1 Reply 6 years 33 weeks ago
1. Main.java:14: error: reached end of file while parsing } ^ 1 error 제출내용 다시확인해보세요 2. Scanner sc는 Scanner 클래스를 sc이름의 객체로, Scanner input 은 Scanner 클래스를 input이름의 객체로 생성합니다. 선언하는 객체 이름의 차이입니다. 3. int와 double은 실수의 한 종류이며, .nextInt는 다음값을 int로 nextDouble은 다음값을 double로 받아온다는 뜻입니다.