note

toSting()클래스 본문

자바/중요 클래스들

toSting()클래스

투한 2011. 12. 27. 11:20
package com.objectex;//ToString참조값

import java.util.Date;


public class ToStringTest {
	public static void main(String[] args) {
		ToStringTest t = new ToStringTest();
		System.out.println(t);
		System.out.println(t.toString());
		System.out.println("------------------");
		System.out.println(new ToStringTest());
		//클래스명.(hashCode() -> 16진수로 변환값)
		
		System.out.println("------------------");
		Date now = new Date();
		System.out.println(now);
		System.out.println(now);
	}
}


com.objectex.ToStringTest@c05d3b
com.objectex.ToStringTest@c05d3b
------------------
com.objectex.ToStringTest@128f6ee
------------------
Tue Dec 27 11:20:35 KST 2011
Tue Dec 27 11:20:35 KST 2011