zoukankan      html  css  js  c++  java
  • Integer的toString()

    1、Integer的toString() 有静态和非静态方法,还有toHexString  以及 toBinaryString、toUnsignedString

    2、Integer还继承了Number类,包括方法:intValue、longValue、floatValue、doubleValue、byteValue、shortValue

    3、Integer.toString(int i); 就是将i转为string

    4、Integer.toString(int par1,int par2),par1表示要转成字符串的数字,par2表示要转成的进制表示,如:

    Integer.toString(100,2),表示把100转成2进制表示的字符串,

    Integer.toString(100,10),表示把100转成10进制表示的字符串,

    Integer.toString(100,16),表示把100转成16进制表示的字符串,

    Integer.toString(100,36),表示把100转成36进制表示的字符串,即100到36之间的数字表示为a到z的表示。  

    ===========================================

    实际应用:牛客网判断子串的一道题 https://ac.nowcoder.com/acm/problem/13253?&headNav=acm

    不忘初心,相信自己,坚持下去,付诸实施。
  • 相关阅读:
    iBatis,第二次亲密接触
    微斯人,吾谁与归
    一个月了
    生命在于运动
    眼皮跳了好几天
    往返
    中病毒,学习批处理

    爱如潮水
    今天夏至
  • 原文地址:https://www.cnblogs.com/controller666/p/14536147.html
Copyright © 2011-2022 走看看