cannot find symbol에러는 왜 나는 건가요??

portishead Reply 8 years 32 weeks ago
컴파일 에러인것 같은데 public class Main{ public static void main(String args[]){ long totalMiliseconds = System.currentTimeMillis(); long totalSeconds = totalMilliseconds/1000; long currentSecond = totalSeconds % 60; long totalMinutes = totalSeconds/60; long currentMinute = totalMinutes % 60; long totalHours = totalMinutes / 60; long currentHour = totalHours % 24; System.out.println("Current time is "+currentHour+":"+currentMinute +":"+currentSecond+"GMT"); } } 여기서 4번째줄 long totalSeconds = totalMilliseconds/1000; 에서 문제가 발생했다는데요, Main.java:4:error: cannot find symbol symbol: variable totalMilliseconds location: class Main 이렇게 뜨는데, 도대체 뭐가 잘못됬다는거죠 ㅇㅅㅇ??;; 교재에 나온 그대로 쳤는데... 행여 오타로 잘못되거라고 해도 cannot find symbol이라는 에러가 왜 나는건지 궁금하네요....!!
cjmp1 Reply 8 years 32 weeks ago
L자 소문자로 선언은 mili 하셨는데 쓸때 milli 하셨네요 Cannot find symbol은 변수같은게 선언되지않았는데 쓰일때 뜹니다
withcs1 Reply 8 years 32 weeks ago
오호 그렇군요. java에 대해 새로운 사실 하나 알았네요. 감사합니다.