Primitive Type(기본 자료형)

 [자료형별로 가지고 있는 특징들]

[자료형별로 가지고 있는 특징들]

<aside> 💡 BigInteger long자료형 보다 더 큰 정수형이 필요할 경우 사용하는 Reference Type 자료형으로 기본 자료형 처럼 연산자를 이용한 연산은 할 수 없다. 대신 BigInteger가 제공하는 사칙 연산 메소드인 .add(), .subtract(), .multiply(), .divide()를 이용해 간단한 연산을 할 수 있다.

</aside>

Reference Type(참조 자료형)

Class Type

public final class String
    implements java.io.Serializable, Comparable<String>, CharSequence,
               Constable, ConstantDesc {

    @Stable
    private final byte[] value;

//////////////......<중략>......//////////////

    private static final ObjectStreamField[] serialPersistentFields =
        new ObjectStreamField[0];

    public String() {
        this.value = "".value;
        this.coder = "".coder;
    }

    @HotSpotIntrinsicCandidate
    public String(String original) {
        this.value = original.value;
        this.coder = original.coder;
        this.hash = original.hash;
    }

    public String(char value[]) {
        this(value, 0, value.length, null);
    }
//////////////......<중략>......//////////////
}
public class ReferenceType {
    public static void main(String[] args){
				// new를 사용하여 String 타입으로 객체 생성
        String string1 = new String();
				//큰따옴표("")로 묶어서 표현하는 문자열은 String객체로 인식
        String string2 = "String Type"; 
    }
}

Array Type