doublevalue_Java Integer类doubleValue()方法与示例

doublevalue

整数类doubleValue()方法 (Integer class doubleValue() method)

  • doubleValue() method is available in java.lang package.

    doubleValue()方法在java.lang包中可用。

  • doubleValue() method is used to return the value denoted by this Integer object converted to type double (by casting).

    doubleValue()方法用于返回此Integer对象表示的值,该值转换为double类型(通过强制转换)。

  • doubleValue() 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.

    doubleValue()方法是一种非静态方法,只能通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。

  • doubleValue() method does not throw an exception at the time of conversion from Integer to double.

    从Integer转换为double时, doubleValue()方法不会引发异常。

Syntax:

句法:

    public double doubleValue();

Parameter(s):

参数:

  • It does not accept any parameter.

    它不接受任何参数。

Return value:

返回值:

The return type of this method is double, it returns a converted (from type Integer to double) value represented by this Integer object.

此方法的返回类型为double ,它返回此Integer对象表示的转换后的值(从Integer类型转换为double类型)。

Example:

例:

// Java program to demonstrate the example 
// of doubleValue() method of Integer class
public class DoubleValueOfIntegerClass {
public static void main(String[] args) {
// Variables initialization
int i1 = 20;
int i2 = 30;
// It returns double value denoted by this Integer ob1 object
// and converted to a double by calling ob1.doubleValue()
Integer ob1 = new Integer(i1);
// Display ob1 result
System.out.println("ob1.doubleValue(): " + ob1.doubleValue());
// It returns double value denoted by this Integer ob2 object
// and converted to a double by calling ob2.doubleValue()
Integer ob2 = new Integer(i2);
// Display ob2 result
System.out.println("ob2.doubleValue(): " + ob2.doubleValue());
}
}

Output

输出量

ob1.doubleValue(): 20.0
ob2.doubleValue(): 30.0

翻译自: https://www.includehelp.com/java/integer-class-doublevalue-method-with-example.aspx

doublevalue

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/380654.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

MVVM实践教程

算算,从事Silverlight和WPF的开发也有1年多的时间了,虽然时间不算长,虽然还没有突出的成就,但是感觉也还算一般。 但是,从头至今都没有去认真研究和使用过MVVM,虽然它被认为是Silverlight和WPF开发的最佳架…

32位通用寄存器ESP、EIP、EAX、EBX、ECX、EDX,在OD里操作这些寄存器

EIP:指向CPU下一步即将执行的指令 I EIP为00401000,表示,CPU下一步到00401000这个地址去执行,下一步执行push 0x0指令 ESP:始终指向堆栈的最顶端 现在的ESP是0012FFC4,现在堆栈的顶部在这个地址 EAX、EBX、…

aud to php,HKD to PHP

Exchange1 HKD6.27 PHPExchange 1 港元6.27 菲律宾比索Exchange5 HKD31.36 PHPExchange 5 港元31.36 菲律宾比索Exchange10 HKD62.71 PHPExchange 10 港元62.71 菲律宾比索Exchange50 HKD313.55 PHPExchange 50 港元313.55 菲律宾比索Exchange100 HKD627.11 PHPExchange 100 港…

kotlin 二进制_Kotlin程序检查数字是否为二进制

kotlin 二进制Given a number, we have to check whether given number is a binary or not. 给定一个数字,我们必须检查给定的数字是否为二进制。 Example: 例: Input:start 15end 700Output:[153, 370, 371, 407]在Kotlin中检查数字是否为二进制的…

ComboBox联动

//从webservice中取数据ajax Ext.Ajax.request({ url: WebService.asmx/GetComboxFirst, method: POST, //jsonData: { UserName: "" }, headers: { Content-Type: application/json;utf-8 …

汇编add和mov指令

汇编指令add: 格式:add 参数1, 参数2 功能:参数1和参数2相加,将结果赋值给参数1,即 :参数1参数1参数2 汇编指令 mov: 格式:MOV destination,source 功能:将源…

把.NET程序部署到没有安装.NET Framwork的机器上

摘要本文讨论了如何使用Windows Installer技术发布.NET程序,以及如何使用native代码判断目标机器上是否安装有.NET Framework; 如果没有,将自动安装.NET Framework然后安装作者自己的.NET程序。 ------------------------------------------------------…

双层玻璃窗的功效模型matlab,数学建模:双层玻璃窗的功效,80人%的人搞不懂数学的应用价值...

原标题: 数学建模:双层玻璃窗的功效,80人%的人搞不懂数学的应用价值A.Einstein有一句名言:想象力比知识更重要,因为知识是有限的,而想象力包括世界的一切,推动着进步,并且是知识的源…

Java LinkedList addLast()方法与示例

LinkedList addLast()方法 (LinkedList addLast() method) This method is available in package java.util.LinkedList. 软件包java.util.LinkedList中提供了此方法。 This method is used to insert an object at the last or ending stage of the linked list. 此方法用于在…

8086CPU物理地址

8086CPU有20位地址总线,可以传送20位地址,达到1MB寻址能力,但8086CPU内部是16位,表现出来的寻址能力只有64kb。 8086CPU采用一种在内部用用两个16位地址合成的方法来形成一个20位的物理地址。 CPU中的相关部件提供两个16位地址&a…

json php input,在php中读取json输入

php://输入在localhost中正常工作.但在服务器中它返回空.输入(请求)到我的站点是一个json(REST – 应用程序/ json类型),所以$_POST不起作用(请阅读This question).$_POST works with key-value pair type inputs like form-data or x-www-urlencodedkey1value1&…

8086的CS段寄存器(IP)

8086共有四个段寄存器,分别为CS,DS,SS,ES CS为代码段寄存器,还有个与CS息息相关的寄存器叫IP,为指令指针寄存器。 在8086PC机中,设CS中的内容为M,IP的内容为N,8086CPU将从…

array_reverse_PHP array_reverse()函数与示例

array_reversePHP array_reverse()函数 (PHP array_reverse() function) array_reverse() function is used to returns an array in reverse order, it accepts an array and returns a new array with values in reverse order. array_reverse()函数用于以相反的顺序返回数组…

hibernate中PO对象的三种状态分析以及session中的一些方法的区别

hibernate的状态 hibernate的各种保存方式的区(save,persist,update,saveOrUpdte,merge,flush,lock)及 对象的三种状态 hibernate的保存 hibernate对于对象的保存提供了太多的方法,他们之间有很多不同,这里细说一下,以便区别。 一、预备知识 …

思绪飞扬(一)

喜欢一个呆在房间了,听着音乐,冲一杯香甜的牛奶。任自已的思绪在空气中放飞!似乎这一刻天地之间只有自已。 想想自已已经历了人生的近三分之一的时光。回首之间,二十几年的时间,我们经历了很多事,有…

nginx php fpm 日志,nginx下php-fpm不记录php报错日志怎么办?

解决nginx下php-fpm不记录php报错日志的办法:1、修改【php-fpm.conf】中配置,没有则增加;2、修改【php.ini】中配置,没有则增加;3、重启【php-fpm】即可。解决nginx下php-fpm不记录php报错日志的办法:1.修改php-fpm.co…

jmp、JE、JZ、JNE、JNT指令

JMP JMP 指令无条件跳转到目标地址,该地址用代码标号来标识,并被汇编器转换为偏移量 格式: JMP destination当 CPU 执行一个无条件转移时,目标地址的偏移量被送入指令指针寄存器,从而导致迈从新地址开始继续执行。 …

ruby hash方法_Ruby中带有示例的Hash.length方法

ruby hash方法哈希长度方法 (Hash.length Method) In this article, we will study about Hash.length Method. The working of this method can be predicted with the help of its name but it is not as simple as it seems. Well, we will understand this method with the…

【转贴备忘】[教程]iPhone 實機開發 Part 1 - HelloWorld

http://bbs.weiphone.com/read-htm-tid-222380-page-1.html最近小弟開始在研究 iPhone 的開發,無奈找到的資料都是舊的,也不知道怎麼放到 iPhone 上,應該很多人都跟我有同樣的困擾吧!經過幾天的研究總算寫出第一個 HelloWorld,而且可以不用付99元美金就可以放到實機上執行! 今天…

final 在java,final 在java中的注意点

注意事项慢慢积累final 类不可被继承,也不能有子类。final class Book{}//class ComBook extends Book{} 这将编译失败,因为Book类不可被继承。final方法不可被改写class Book{final void show(){System.out.println("Book的show()方法”)&…