Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- architecture
- Pipelining
- MacOS
- instruction
- control
- DATAPATH
- php
- system
- XML
- Class
- DoM
- mysql
- Linux
- while
- DS
- DB
- Java
- data structure
- javascript
- react
- python
- MIPS
- html
- function
- computer
- Algorithm
- CSS
- web
- github
- for
Archives
- Today
- Total
YYYEJI
[JAVA] 자바에서 주석(comment) 처리하는 방법 본문
728x90
자바에서 주석 처리하는 방법에 대해서 알아봅시다.
public static void main(String[] args) {
System.out.print("Hi~ ");
System.out.print("there.");
}
여기서 두번째 print문을 주석 처리를 하게 되면
public static void main(String[] args) {
System.out.print("Hi~ ");
// System.out.print("there.");
}
두 번째 문자는 출력되지 않습니다.
한 번에 여러 줄을 주석 처리하는 방법을 알아보겠습니다.
public static void main(String[] args) {
System.out.print("Hi~ ");
System.out.print("there.\n");
System.out.print("Welcome to My Blog!");
}
/* */를 사용하면 여러 줄을 한 번에 주석 처리할 수 있습니다.
/*
System.out.print("Hi~ ");
System.out.print("there.\n");
System.out.print("Welcome to My Blog!");
*/
NOTE) 주석 처리를 원하는 줄에 커서를 두고 Command(⌘) + slash(/)를 누르면 주석 처리가 됩니다.
◡̈
'Java' 카테고리의 다른 글
[JAVA] 변수(variable)란? (0) | 2022.12.23 |
---|---|
[JAVA] 이클립스 The selection cannot be launched, and there are no recent launches 오류 해결하기 (0) | 2022.11.03 |
[JAVA] Delimiter란? (0) | 2022.10.23 |
[JAVA] 사용자로부터 값 입력받기 (Scanner) (0) | 2022.10.23 |
[JAVA] 자바 console에 결과 출력하기 (0) | 2022.10.23 |