[Java] 해시코드(hash code)

쓰옹·2022년 12월 1일
0

📙 Java 잡아🤏

목록 보기
19/25
post-thumbnail

해시코드(hash code)

  • JVM에서 객체가 생성되었을 때 생성된 객체에 할당하는 가상 메모리 주소값
package section2.classpart;

public class StudentTest {
    public static void main(String[] args) {
        Student studentAhn = new Student();
        studentAhn.studentName = "홍길동";  // 참조변수.멤버변수

        Student student2 = new Student();
        student2.studentName = "김철수";

        //클래스이름@주소값; 출력 주소값==hash code값
        System.out.println(studentAhn);
        System.out.println(student2);
    }
}
profile
기록하자기록해!

0개의 댓글