java学习笔记33:Byte的基本方法
发布日期:2021-05-07 02:03:22 浏览次数:25 分类:精选文章

本文共 1069 字,大约阅读时间需要 3 分钟。

Byte

Byte(byte value) :使用指定的byte值构造一个新的Byte。Byte(String s) :使用s构造一个新的Byte对象,s为byte范围内的整数byte byteValue() :返回此值Byte作为byte。double doubleValue() :将此对象转换为基本数据类型double。int intValue() :将此对象转化为intlong longValue() :将此对象转化为long。short shortValue() :将此对象转化为short。float floatValue() :将此对象转化为float。boolean equals(Object obj) :将此对象与指定的对象进行比较。int compareTo(Byte anotherByte) :用Byte数字比较两个对象。int hashCode() :返回此Byte的哈希码; 等于调用的结果intValue()。String toString() :把此对象的值转化为Sting返回 。String toString(byte b) :把指定的byte转化为String。int hashCode(byte value) :返回byte值的哈希码; 兼容Byte.hashCode()。int toUnsignedInt(byte x) :通过无符号转换将参数转换为int。long toUnsignedLong(byte x) :通过无符号转换将参数转换为long 。Byte valueOf(byte b) :指定byte值,返回Byte表示的实例 。Byte valueOf(String s) :使用s构造一个新的Byte对象,s为byte范围内的整数。Byte valueOf(String s, int radix) :返回一个Byte对象,该对象保存String使用第二个参数给出的基数(计算机进制)解析时从指定的值中提取的值。int compare(byte x, byte y) :以byte数字方式比较两个值。Byte decode(String nm) :String将解码为Byte。(String可以为10进制、16进制。8进制)nm可能的值:99、0xf、071byte parseByte(String s) :将字符串参数解析为带符号的byte。byte parseByte(String s, int radix) :将字符串参数解析为byte,第二个参数指定的计算进制。
上一篇:java学习笔记34:Charactor的基本方法
下一篇:java学习笔记32:装箱与拆箱

发表评论

最新留言

路过按个爪印,很不错,赞一个!
[***.219.124.196]2025年04月04日 11时07分16秒