Naming Convention
- 코드 작성 시 변수, 함수, 클래스, 패키지 등 다양한 요소에 일관된 이름 규칙을 적용하는 것.
- 코드의 가독성과 유지 보수성을 높일 수 있다.
- 대표적으로 Camel Case와 Pascal Case가 있다.
(1) Camel Case
- 첫 글자는 소문자로, 이후 단어의 첫 글자는 대문자로 작성.
- 변수명, 메소드(함수)명에 사용.
- ex) botName, sendMessage()
(2) Pascal Case
- 단어의 첫 글자를 대문자로 작성.
- 클래스명, 인터페이스명에 사용.
- ex) public class Request, public interface Sender
Pascal case vs. camel case: What's the difference? | TheServerSide
The difference between Pascal case and camel case is minor, but not knowing your variable naming conventions can land you outside of code compliance.
www.theserverside.com
'Java' 카테고리의 다른 글
[Java] String, StringBuilder, StringBuffer (1) | 2024.10.06 |
---|---|
[Java] Java에서의 Stream (스트림) (0) | 2024.09.12 |
[Java] Java Logging (0) | 2024.09.11 |
[Java] Maven (메이븐) (2) | 2024.09.11 |
[Java] 14. Collections Framework (0) | 2024.09.02 |