class로 정의된 타입을 쓸때는 모두 참조 자료형이다.
import java.util.Arrays;
public class Main{
public static void main(String[] args){
String thatThat = "thatThat";
System.out.println(thatThat);
//[]배열을 나타냄
//int [] 자료형은 기본 int 자료형이 아니므로 참조 자료형
int[] intArray = new int[] {1 , 2, 3, 4, 5};
System.out.println(Arrays.toString(intArray));
}
}
'java > basic 문법' 카테고리의 다른 글
상속(inheritance) (0) | 2022.08.02 |
---|---|
생성자(constructor) (0) | 2022.08.02 |
객체 지향 언어 (클래스, 인스턴스 ,메서드) (0) | 2022.08.01 |
변수와 상수 (0) | 2022.07.27 |
Java의 역사 (0) | 2022.07.27 |
댓글