class 괴 public class의 차이
클래스명 앞에 public이라는 접근제어자를 추가하면 그 클래스의 이름은 파일명과 동일해야하는 규칙이 있음
이렇게 하는 이유는 하나의 자바 파일에 여러 개의 클래스를 작성하는 경우에 하나의 대표 클래스를 지정하고 파일명과 동일하게 하는 것이 가독성이 도움이 된다고 함
'IT개발정보 > spring and java' 카테고리의 다른 글
[error] org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: (0) | 2023.02.08 |
---|---|
Spring Framework 버젼 확인 (0) | 2023.02.08 |
Spring Annotation (0) | 2023.02.07 |
클래스, 객체, 인스턴스의 개념 (0) | 2023.02.07 |
[error] Error creating bean with name 'sqlSessionFactory' (0) | 2023.02.05 |