当前位置:网站首页>将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);
}
}
边栏推荐
- 项目实战第二十七讲:状态模式在重名品牌中的应用
- Switches and routers technology - 21 - RIP routing protocol
- Idea 2021.3.3版本文件目录展开
- async(异步)和await的使用
- Use Adobe genuine software for prostitution to reduce the slow employment and non-employment of fresh graduates
- Switch and Router Technology - 36-Port Mirroring
- IDEA模板总结
- Apache Commons OGNL语法说明_翻译
- 面试题整理
- Delphi7学习记录-demo实例
猜你喜欢
Switch and Router Technology-31-Extended ACL
[Embedded open source library] The use of cJSON, an efficient and streamlined json parsing library
2021 Network Planning Designer Afternoon Case Questions
Switch and Router Technology-35-NAT to PAT
shell 脚本编程---入门
Paper Notes: BBN: Bilateral-Branch Network with Cumulative Learning for Long-Tailed Visual Recognition
C Language: Practical Debugging Tips
How to use svg-icon (svg-sprite-loader plugin)
Idea提升工作效率的必备技巧
BGP综合实验
随机推荐
MySQL存储引擎概念
ARM结构体系4:嵌入式硬件平台接口开发
C语言题解:谁是凶手!
Switches and routers technologies - 30 - standard acls
Configure checkstyle in IDEA
nodes服务器
提升你工作效率的技巧,你得知道——Navitcat 快捷键
绿盾加密如何顺利切换成IP-Guard加密
2022 building welder (building a special type of work) examination questions and simulation test
Switch and Router Technology-29-OSPF Virtual Link
Sub-database sub-table ShardingSphere-JDBC notes arrangement
FPGA engineer interview questions collection 111~120
Some common mysql entry exercises
MySQL事务的概念
Oracle中如何用一个表的数据更新另一个表中的数据_转载
redis分布式锁
Let's talk programming languages together
Internet Protocol 1
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/data/xxxx
Redis详解