반응형
주석(comment)
주석은 프로그래밍적으로 해석되지 않는다.
한줄 주석
public static void main(String[] args) {
// 두개의 변수가 같은 데이터 타입 일 때 아래와 같이 코드를 작성한다.
String a, b;
}
JavaDoc 주석
/**
* Prints an integer and then terminate the line. This method behaves as
* though it invokes <code>{@link #print(int)}</code> and then
* <code>{@link #println()}</code>.
*
* @param x The <code>int</code> to be printed.
*/
public void println(int x) {
synchronized (this) {
print(x);
newLine();
}
}
세미콜론
// assignment statement
aValue = 8933.234;
// increment statement
aValue++;
// method invocation statement
System.out.println("Hello World!");
// object creation statement
Bicycle myBike = new Bicycle();
'Java' 카테고리의 다른 글
[JAVA] static이란 무엇인가!! (0) | 2024.04.11 |
---|---|
[JAVA] 다형성 왜 쓸까? (0) | 2024.04.10 |
java)5일차 변수 (0) | 2022.02.27 |
java)4일차 -참조 (0) | 2022.02.26 |
Java)3일차 (0) | 2022.02.25 |