你找找有相应的method么。看看api,如果没有,就只能用数据结构里面的笨办法了。

解决方案 »

  1.   

    Integer.toString(int i,int radix)方法的第二个参数表明该整数以什么进制进行转换(2表示以二进制转换)...,如
    <%
    out.print(Integer.toString(10,2));
    %>public static String toString(int i,
                                  int radix)
    Returns a string representation of the first argument in the radix specified by the second argument. 
    If the radix is smaller than Character.MIN_RADIX or larger than Character.MAX_RADIX, then the radix 10 is used instead. 
      

  2.   

    Integer.toBinaryString();
    把整型数转换为二进制的字符串