当前位置:网站首页>将double类型的数据转为字符串
将double类型的数据转为字符串
2022-08-11 05:12:00 【余谦吖】
将double类型的数据3.1415926转为字符串
package Day0712;
/**
* 将double类型的数据3.1415926转为字符串
*/
public class Four {
public static void main(String[] args) {
double a = 3.1415926;
//第一种(强转)
String toString1 = ""+a;
//第二种(通过string的方法转换)
String toString = String.valueOf(a);
System.out.println(toString);
System.out.println(toString1);
}
}
边栏推荐
- MySQL索引
- 【嵌入式开源库】使用J-Link打印日志,让你节省一个打印串口
- MySQL必知必会(初级篇)
- Golden Warehouse Database KingbaseGIS User Manual (6.10. Geometric Object Operation Operator)
- 提升你工作效率的技巧,你得知道——Navitcat 快捷键
- 2022 building welder (building a special type of work) examination questions and simulation test
- 项目实战第二十七讲:状态模式在重名品牌中的应用
- Switch and Router Technology - 36-Port Mirroring
- MyEclipse数据库工具使用教程:使用驱动程序
- async(异步)和await的使用
猜你喜欢

Use Adobe genuine software for prostitution to reduce the slow employment and non-employment of fresh graduates

redis分布式锁

prometheus:(二)监控概述(你永远逃不出我的手掌哈哈)

【嵌入式开源库】使用J-Link打印日志,让你节省一个打印串口

Idea 2021.3.3版本文件目录展开

C language antithesis: who is the murderer!

Switches and routers technology - 26 - configure OSPF peripheral area

Unity WebGL RuntimeError: integer overflow

宝塔Linux环境下redis开启多端口

Redis-数据类型(基本指令、String、List、Set、Hash、ZSet、BitMaps、HyperLogLog、GeoSpatial)/发布和订阅
随机推荐
Golden Warehouse Database KingbaseGIS User Manual (6.10. Geometric Object Operation Operator)
[Untitled] 2022 Amination Process Exam Questions Mock Exam Question Bank and Online Mock Exam
Redis中RDB和AOF的区别
Idea essential skills to improve work efficiency
宝塔Linux环境下redis开启多端口
How to read a paper
MyEclipse数据库工具使用教程:使用驱动程序
MFC 进程间通信(共享内存)
In the closing pages/uninstall (unload) sends a request to the server before the document
C语言:实用调试技巧
Zabbix builds enterprise-level monitoring and alarm platform
Paper Notes: BBN: Bilateral-Branch Network with Cumulative Learning for Long-Tailed Visual Recognition
Oracle常用语句归纳_持续更新
@Resource和@Autowired的区别
[QNX Hypervisor 2.2用户手册]10.15 vdev timer8254
The use of async (asynchronous) and await
Delphi7 learning record - demo example
Unity WebGL RuntimeError: integer overflow(整数溢出问题)
关于CC 攻击
Switch and Router Technology - 32 - Named ACL