java.lang.Integer

java.lang.IntegerpublicstaticintbitCount(intarg0)//二进制中出现1的数量publicbytebyteValue()//转化为bytepublicstaticintco

大家好,又见面了,我是你们的朋友全栈君。

public static int bitCount(int arg0)//二进制中出现1的数量
public byte byteValue()//转化为byte
public static int compare(int arg0,int arg1)//比较两者大小
public int compareTo(Integer arg0)//与某个值比较大小
public volatile int compareTo(Object arg0)
public static int compareUnsigned(int arg0,int arg1)//无符号比较,转成二进制后,最高位也参与值的相加,然后比较大小
public static Integer decode(String arg0)//合适用来分析数字

8进:010=>分析后为 8
10进:10=>分析后为 10
16进:#10|0X10|0x10=>分析后是 16
而valueof    只能数字的String
像 010 这样的8进制 他会解析成 =>10

public static int divideUnsigned(int arg0,int arg1)//无符号相除
public double doubleValue()//转化为double
public boolean equals(Object arg0)
public float floatValue()//转化为float
public final native Class getClass()
public static Integer getInteger(String arg0,Integer arg1)//arg0用于获取系统中的数字,arg1为默认值。String v = System.getProperty(arg0);return Integer.decode(v);
public static Integer getInteger(String arg0,int arg1)//同上
public static Integer getInteger(String arg0)//同上
public static int hashCode(int arg0)//获取arg0的hashcode
public int hashCode()
public static int highestOneBit(int arg0)
public int intValue()//返回int值
public long longValue()//返回long值
public static int lowestOneBit(int arg0)
public static int max(int arg0,int arg1)//返回最大值
public static int min(int arg0,int arg1)//返回最小值
public final native void notify()
public final native void notifyAll()
public static int numberOfLeadingZeros(int arg0)//最高位开始连续0的个数
public static int numberOfTrailingZeros(int arg0)//最低位开始连续0的个数
public static int parseInt(String arg0)//把String转化为int,arg0为要解析的字符串,默认10进制
public static int parseInt(String arg0,int arg1)//把String转化为int,arg0为要解析的字符串,arg1为进制
public static int parseUnsignedInt(String arg0)//把String转化为int,arg0为无符号数,也就是比有符号大一倍,但二进制计算是有符号的,arg0为要解析的字符串,默认10进制
public static int parseUnsignedInt(String arg0,int arg1)//把String转化为int,arg0为无符号数,也就是比有符号大一倍,但二进制计算是有符号的,arg0为要解析的字符串,arg1为进制
public static int remainderUnsigned(int arg0,int arg1)//无符号取余数,arg0为无符号数,也就是比有符号大一倍,但二进制计算是有符号的,arg1为进制
public static int reverse(int arg0)//二进制反转,再计算
public static int reverseBytes(int arg0)//以字节单位反转,再计算
public static int rotateLeft(int arg0,int arg1)//把最高位放到最低位,如此下去arg1次,再计算
public static int rotateRight(int arg0,int arg1)//把最低位放到最高位,如此下去arg1次,再计算
public short shortValue()//返回short值
public static int signum(int arg0)//正数返回1,负返回-1
public static int sum(int arg0,int arg1)//求和
public static String toBinaryString(int arg0)//十进制转成二进制,如果负数,32个字符,最高位为1,如果为正数,位数不固定,但不超过32个字符
public static String toHexString(int arg0)//十进制转成16进制
public static String toOctalString(int arg0)//十进制转成8进制
public static String toString(int arg0,int arg1)//把arg0转为arg1进制
public String toString()
public static String toString(int arg0)//把arg0转为10进制
public static long toUnsignedLong(int arg0)//转成long,计算时把最高位也算上,这时不代表符号
public static String toUnsignedString(int arg0)//同上
public static String toUnsignedString(int arg0,int arg1)//同上,arg1为进制数
public static Integer valueOf(String arg0,int arg1)//构建Integer,arg0为要转的数值,arg1为进制
public static Integer valueOf(int arg0)//构建Integer,arg0为要转的数值,默认10进制
public static Integer valueOf(String arg0)//构建Integer,arg0为要转的数值,默认10进制
public final void wait()
public final void wait(long arg0,int arg1)
public final native void wait(long arg0)

parseInt,都可以解释2 8 16进制的-号(在返回的数前加个-),但2进制最前面的1不能解释为负号,即使第32位为1也不能,反面会因为数过大而报错
toOctalString toHexString,如果加了-号,输出的并不是对应的负数
toBinaryString,如果加了-号,可以输出负数对应的2进制数,如果不加-号,输出的数正确,但并不是32位
toString,都可以解释为对应的-号(在返回的数前加个-),-号在2进制中也一样只是直接在返回中加个-号,注意的是2进制最前面的1不能解释为负号
parse的无符号指的是接收参数无符号,即本来-128-127,变成0-256,意在对参数检查时扩大范围,除些外的其他无符号是对二进制的无符号处理,即把最高位也拿出来计算值的大小

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/154697.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 字符指针 赋值

    字符指针 赋值字符串赋值给字符指针(char*a=“hello”)的正确理解方式 对于语句 char*a=”hello”;       对于这个声明方式,会造成的误解是:声明了一个字符指针(它会指向一个位置),将“字符串”赋值给指针表达式”*a”所指向的地址。但正解是:声明了一个字符指针后,并用字符串常量的第一个字符的地址赋值给指针变量a。       即正确顺序是:1.分配

    2022年7月11日
    15
  • Springboot跨域的四种方式[通俗易懂]

    Springboot跨域的四种方式[通俗易懂]Springboot跨域的四种方式

    2022年4月23日
    46
  • Python列表(list)详解[通俗易懂]

    Python列表(list)详解[通俗易懂]Python内置的四种常用数据结构:列表(list)、元组(tuple)、字典(dict)以及集合(set)。这四种数据结构一但都可用于保存多个数据项,这对于编程而言是非常重要的,因为程序不仅需要使

    2022年7月3日
    36
  • kafka介绍和使用[通俗易懂]

    kafka介绍和使用[通俗易懂]1.1.      主要功能根据官网的介绍,ApacheKafka®是一个分布式流媒体平台,它主要有3种功能:  1:Itletsyoupublishandsubscribetostreamsofrecords.发布和订阅消息流,这个功能类似于消息队列,这也是kafka归类为消息队列框架的原因  2:Itletsyoustorestreamsofrecordsin…

    2022年10月13日
    0
  • Protel99SE快捷键大全

    Protel99SE快捷键大全protel99se快捷键enter——选取或启动esc——放弃或取消f1——启动在线帮助窗口tab——启动浮动图件的属性窗口pgup——放大窗口显示比例pgdn——缩小窗口显示比例end——刷新屏幕del——删除点取的元件(1个)ctrl+del——删除选取的元件(2个或2个以上)x+a——取消所有被选取图件的选取状态x——将浮动图件左右翻转y——将浮动图件上下翻转space——将浮动图件旋转90度crtl+ins——将选取图件复制到编辑区里shift+ins——将剪贴板里的

    2022年5月30日
    31
  • Linux——vi命令详解[通俗易懂]

    Linux——vi命令详解[通俗易懂]vi编辑器是所有Unix及Linux系统下标准的编辑器,它的强大不逊色于任何最新的文本编辑器,这里只是简单地介绍一下它的用法和一小部分指令。由于对Unix及Linux系统的任何版本,vi编辑器是完全相同的,因此您可以在其他任何介绍vi的地方进一步了解它。Vi也是Linux中最基本的文本编辑器,学会它后,您将在Linux的世界里畅行无阻。

    2022年6月9日
    85

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号