java中intvalue_Java Byte类intValue()方法的示例
java中intvalue
字节类intValue()方法 (Byte class intValue() method)
intValue() method is available in java.lang package.
intValue()方法在java.lang包中可用。
intValue() method is used to return the value denoted by this Byte object converted to type int (by casting).
intValue()方法用于返回将此Byte对象表示的值转换为int类型(通过强制转换)。
intValue() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.
intValue()方法是一个非静态方法,只能通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。
intValue() method does not throw an exception at the time of conversion from byte to int.
从字节转换为int时, intValue()方法不会引发异常。
Syntax:
句法:
public int intValue();
Parameter(s):
参数:
It does not accept any parameter.
它不接受任何参数。
Return value:
返回值:
The return type of this method is int, it returns a converted (from type byte to int) value represented by this Byte object.
此方法的返回类型为int ,它返回此Byte对象表示的转换后的值(从类型byte到int )。
Example:
例:
// Java program to demonstrate the example
// of intValue() method of Byte class
public class IntValueOfByteClass {public static void main(String[] args) {// Variables initialization
byte value1 = 100;
byte value2 = 50;
// It returns byte value denoted by this Byte ob1 object
// and converted to a int by calling ob1.intValue()
Byte ob1 = new Byte(value1);
// Display ob1 result
System.out.println("ob1.intValue(): " + ob1.intValue());
// It returns byte value denoted by this Byte ob2 object
// and converted to an int by calling ob2.intValue()
Byte ob2 = new Byte(value2);
// Display ob2 result
System.out.println("ob2.intValue(): " + ob2.intValue());
}
}
Output
输出量
ob1.intValue(): 100
ob2.intValue(): 50
翻译自: https://www.includehelp.com/java/byte-class-intvalue-method-with-example.aspx
java中intvalue
java中intvalue_Java Byte类intValue()方法的示例相关推荐
- java中intvalue_Java Short类intValue()方法及示例
java中intvalue 短类intValue()方法 (Short class intValue() method) intValue() method is available in java. ...
- java中intvalue_Java Float类intValue()方法与示例
java中intvalue 浮动类intValue()方法 (Float class intValue() method) intValue() method is available in java ...
- java中intvalue_Java Integer类intValue()方法的示例
java中intvalue 整数类intValue()方法 (Integer class intValue() method) intValue() method is available in ja ...
- java中intvalue方法作用_Java Integer类intValue()方法及示例
整数类intValue()方法intValue()方法在java.lang包中可用. intValue()方法用于返回此Integer对象表示的值,该值转换为int类型(通过强制转换). intVal ...
- java中拦截这个类的方法_类拦截器和方法拦截器
一.拦截器 1.拦截器小介 拦截器的功能类似于web.xml文件中的Filter,能对用户的请求进行拦截,通过拦截用户的请求来实现对页面的控制.拦截器是在Struts-core-2.2.3.jar中进 ...
- Java中包、类、方法、属性、常量的命名规则
1:包(package):用于将完成不同功能的类分门别类,放在不同的目录(包)下, 包的命名规则:对于包名:每个字母都需要小写. 将公司域名反转作为包名.比如www.baidu.com 比如:com. ...
- Java 中利用Calendar类的方法判断当前年是闰年还是平年
分析以下需求,并用代码实现要求:利用Calendar类的方法判断当前年是闰年还是平年提示:方式1闰年:二月有29天将日期设置为3月1号,然后倒退1天至2月底,求出2月底是多少天方式2闰年条件:如果当前 ...
- java super.getclass_Java Class 类 getSuperClass()方法及示例
Class类getSuperClass()方法getSuperClass()方法在java.lang包中可用. getSuperClass()方法用于返回Class,该Class表示此Class表示的 ...
- java long short_Java Long类shortValue()方法与示例
Long类shortValue()方法shortValue()方法在java.lang包中可用. shortValue()方法用于返回由此Long对象表示的值,该对象转换为short类型(通过强制转换 ...
最新文章
- arXiv爆款:想了解Attention就看它!清华计图胡事民团队出品
- java {@link},Javadoc @see或{@link}?
- Chapter8 用例建模
- 关于LOH(Large Object Heap)及内存泄漏
- boost::hana::equal用法的测试程序
- NC33-合并两个有序的链表
- Android新增Activity,并实现多Activity之间的切换
- 逻辑回归 python_深入研究Python的逻辑回归
- hdu4000 amp;amp; hrbust1625
- java21天打卡-day2
- dynamic programming动态规划初步理解【-1】
- 计算机考医学考研方向,医学考研科目都有哪些方向
- LintCode Copy Books
- couchbase php,CouchBase + PHP 安装与配置
- Codeforces - 1152B - Neko Performs Cat Furrier Transform
- 毕业设计 英雄联盟数据分析与预测 -大数据分析 可视化 机器学习
- IKEA(宜家)营销神话——“让用户成为产品的创造者”!
- 如何利用origin提取原始数据
- win7电脑读不出u盘解决方法
- ext2fsd 源码 分析
热门文章
- python 除数不能为零的报错有哪些_【社区精选40】Python错误处理及代码调试方法(文末赠书中奖名单)...
- MySQL学习(2)
- 哈哈机器人送到冰雪小镇_从小镇到上海:两代人的接力洄游 | 活动回顾
- bash shell是如何识别特殊符号的
- 日常问题——Mac下新建目录报Read-only file system
- Apache 虚拟主机的配置[Ubuntu]
- textmate bundle for jquery
- 【喜报】JEEWX荣获“2016 年度码云新增热门开源软件排行榜”第一名!
- ios页面间跳转方式总结
- 我的RSS我做主:My RSS