develog

Object.toString(), System.identityHashCode() 본문

Dev/Java

Object.toString(), System.identityHashCode()

냐옴 2013. 7. 2. 13:19

Object obj = new Object();

System.out.println("1. " + obj.toString());


System.out.print("2. ");

System.out.print(obj.getClass().getName());

System.out.print("@");

System.out.print(Long.toHexString(System.identityHashCode(obj)));

System.out.println();


// console

1. java.lang.Object@1c78e57

2. java.lang.Object@1c78e57

'Dev > Java' 카테고리의 다른 글

generate file name  (0) 2013.07.02
String 비교  (0) 2013.07.02
진수 변환  (0) 2013.07.02
log4sql  (0) 2013.06.28
spring pointcut expression syntax  (0) 2013.06.27
Comments