其他类型转String

String s = String.valueOf( value); // 其中 value 为任意一种数字类型。 

字符串型转换成各种数字类型:

String s = "169"; 


byte b = Byte.parseByte( s ); 


short t = Short.parseShort( s ); 


int i = Integer.parseInt( s ); 


long l = Long.parseLong( s ); 


Float f = Float.parseFloat( s ); 


Double d = Double.parseDouble( s );

  

相关文章:

  • 2021-08-20
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2021-05-30
  • 2021-09-17
猜你喜欢
  • 2022-12-23
  • 2021-10-24
  • 2021-10-04
  • 2021-07-22
  • 2021-12-24
  • 2021-05-26
  • 2022-12-23
相关资源
相似解决方案