java迭代遍历值时,为什么会输出16进制,要怎么转换

import java.util.*;
public class qqqq{

private int getBianhao() {
    return bianhao;
}
private void setBianhao(int bianhao) {
    this.bianhao = bianhao;
}
private String getMingchen() {
    return mingchen;
}
private void setMingchen(String mingchen) {
    this.mingchen = mingchen;
}
private Integer bianhao;
private String mingchen;
public qqqq(Integer bianhao,String mingchen){
    this.bianhao=bianhao;
    this.mingchen=mingchen;
}
public static void main(String[]args){
    HashMap<Integer,qqqq> hash=new HashMap<Integer,qqqq>();
    qqqq one1=new qqqq(1,"苹果1");
    qqqq one2=new qqqq(2,"苹果2");
    qqqq one3=new qqqq(3,"苹果3");
    qqqq one4=new qqqq(4,"苹果4");
    qqqq one5=new qqqq(5,"苹果5");

    hash.put(1,one1);
    hash.put(2,one2);
    hash.put(3,one3);
    hash.put(4,one4);
    hash.put(5,one5);
    Collection<qqqq> collection = hash.values();
    Iterator<qqqq> itt=collection.iterator();
    System.out.println("输出值");//输出的老是16进制码
    while(itt.hasNext()){
    System.out.println(itt.next());
    }
    Set<Integer>keys=hash.keySet();
    System.out.println("输出键");
    Iterator tt=keys.iterator();
    while(tt.hasNext()){
        System.out.print(tt.next()+"\t");
    }
    System.out.println("输出完整的信息");
    for(Integer key:keys){
        System.out.println("编号:"+key+"\t名称:"+hash.get(key));
    }
}

}

对象直接输出输出的是该对象存储的地址,你如果非要直接输出对象需要重载对象的toString函数。

代码有空去电脑上运行一下,不运行看不懂啊!

对于非基本类型,若不重写toString()方法,输出的是引用类型的物理地址