不是错误信息,是警告信息。String(byte[],int)该方法被限制使用

解决方案 »

  1.   

    查看一下api文档就行了。
    String有很多个构造函数,但是如下的两个构造函数是加了Deprecated说明的。
    String(byte[] ascii, int hibyte) 
              Deprecated. This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the String constructors that take a character-encoding name or that use the platform's default encoding.
    String(byte[] ascii, int hibyte, int offset, int count) 
              Deprecated. This method does not properly convert bytes into characters. As of JDK 1.1, the preferred way to do this is via the String constructors that take a character-encoding name or that use the platform's default encoding.
        你用的构造函数是String(byte[] ascii, int hibyte) ,该方法不推荐使用,但是如果
    你坚持使用,编译也可以通过,潜在的问题就是不能保证正确将字节码转换为适当编码的字符。
      

  2.   

    调用构造函数或者方法的时候注意一定查阅api核心文档。