从数据库读出的中文输入到控制台是这样的:[B@c68c3[B@b2002f[B@2a4983[B@406199[B@c7b00c[B@1f6f296这写不知道是什么,望大家不吝赐教!

解决方案 »

  1.   

    此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
    楼主【wudaoshengu】截止到2008-07-02 10:55:42的历史汇总数据(不包括此帖):
    发帖的总数量:24                       发帖的总分数:810                      
    结贴的总数量:22                       结贴的总分数:720                      
    无满意结贴数:2                        无满意结贴分:60                       
    未结的帖子数:2                        未结的总分数:90                       
    结贴的百分比:91.67 %               结分的百分比:88.89 %                  
    无满意结贴率:9.09  %               无满意结分率:8.33  %                  
    值得尊敬
      

  2.   

    你的输出错了吧。 你打印的是类吧,不是中文。
    class a
    system.out.println(a); 就是你这样
    system.out.println(a.a);a.a才是内容 
      

  3.   

    你要打印对象的内存地址,如果你要输出你想要的结果可以重写该类的toString()方法
      

  4.   

    public class ArrayString { public static void main(String[] args) {
    byte[] ba = new byte[0];
    short[] sa = new short[0];
    int[] ia = new int[0];
    long[] la = new long[0];
    float[] fa = new float[0];
    double[] da = new double[0];
    char[] ca = new char[0];
    boolean[] bla = new boolean[0];
    System.out.println(ba.toString());
    System.out.println(sa.toString());
    System.out.println(ia.toString());
    System.out.println(la.toString());
    System.out.println(fa.toString());
    System.out.println(da.toString());
    System.out.println(ca.toString());
    System.out.println(bla.toString());
    }}程序输出:[B@de6ced
    [S@c17164
    [I@1fb8ee3
    [J@61de33
    [F@14318bb
    [D@ca0b6
    [C@10b30a7
    [Z@1a758cb其中@后面是十六进制表示的内存地址。
      

  5.   

    你打出来的是内存地址。直接打印一个对象,会默认调用这个对象的toString方法。而在没有复写的前提下,这个方法返回的是内存地址。
      

  6.   

    都是些hash码,把toString重新下。默认的不管用。。
      

  7.   

    这是因为程序调用的是父类(应该是Object)的toString()方法,导致显示了一串乱码,你在你自己的类里面重写这个方法后再跑一次应该就好了吧.
      

  8.   

    说的不准确 纠正
    并非单纯的hashcode
    源码如下    /**
         * Returns a string representation of the object. In general, the 
         * <code>toString</code> method returns a string that 
         * "textually represents" this object. The result should 
         * be a concise but informative representation that is easy for a 
         * person to read.
         * It is recommended that all subclasses override this method.
         * <p>
         * The <code>toString</code> method for class <code>Object</code> 
         * returns a string consisting of the name of the class of which the 
         * object is an instance, the at-sign character `<code>@</code>', and 
         * the unsigned hexadecimal representation of the hash code of the 
         * object. In other words, this method returns a string equal to the 
         * value of:
         * <blockquote>
         * <pre>
         * getClass().getName() + '@' + Integer.toHexString(hashCode())
         * </pre></blockquote>
         *
         * @return  a string representation of the object.
         */
        public String toString() {
    return getClass().getName() + "@" + Integer.toHexString(hashCode());
        }
      

  9.   

    返回的是
    getClass().getName() + '@' + Integer.toHexString(hashCode())