当前位置:网站首页>Integer learning
Integer learning
2022-07-07 14:54:00 【nsnsttn】
/** * @author zzy * @createDate: 2021-11-29 10:24:15 * @description: The source code is relatively simple , Click inside by yourself */
public class Integer Study {
public static void main(String[] args) {
// One : Four kinds of creation Integer Methods , The first three values are -128 ~ 127 Cache this value between
//1.String turn int, Then it is automatically boxed, so there is a cache , The second parameter is base , The default is 10 Base number
Integer i1 = Integer.parseInt("127");
//2.String、int turn Integer, With cache , The second parameter is base , The default is 10 Base number
Integer i2 = Integer.valueOf(127);
//3. Automatic boxing , Automatically call valueOf()
Integer i3 = 127;
//4. Create new objects , No cache
Integer i4 = new Integer(127);
Integer i5 = 127;
System.out.println(i1 == i5);//true
System.out.println(i2 == i5);//true
System.out.println(i3 == i5);//true
System.out.println(i4 == i5);//false
// Two : Hexadecimal conversion
// 10 turn 2
String t2 = Integer.toBinaryString(11);
// 10 turn 8
String t8 = Integer.toOctalString(20);
// 10 turn 16
String t16 = Integer.toHexString(20);
System.out.println(t2);
System.out.println(t8);
System.out.println(t16);
}
}
边栏推荐
- Shengteng experience officer Episode 5 notes I
- 寺岗电子称修改IP简易步骤
- 一文读懂数仓中的pg_stat
- Discussion on CPU and chiplet Technology
- 大厂做开源的五大痛点
- 2022云顾问技术系列之高可用专场分享会
- Niuke real problem programming - day16
- PD虚拟机教程:如何在ParallelsDesktop虚拟机中设置可使用的快捷键?
- #yyds干货盘点# 解决名企真题:交叉线
- 拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条...
猜你喜欢
asp. Netnba information management system VS development SQLSERVER database web structure c programming computer web page source code project detailed design
比尔·盖茨晒48年前简历:“没你们的好看”
"July 2022" Wukong editor update record
CTFshow,信息搜集:web10
时空可变形卷积用于压缩视频质量增强(STDF)
智汀不用Home Assistant让小米智能家居接入HomeKit
用于增强压缩视频质量的可变形卷积密集网络
Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
Full details of efficientnet model
Pinduoduo lost the lawsuit, and the case of bargain price difference of 0.9% was sentenced; Wechat internal test, the same mobile phone number can register two account functions; 2022 fields Awards an
随机推荐
KITTI数据集简介与使用
Data connection mode in low code platform (Part 2)
A laravel background management expansion package you can't miss - Voyager
Several ways of JS jump link
Applet directory structure
Pytorch model trains practical skills and breaks through the bottleneck of speed
暑期安全很重要!应急安全教育走进幼儿园
时空可变形卷积用于压缩视频质量增强(STDF)
拜拜了,大厂!今天我就要去厂里
Apache多个组件漏洞公开(CVE-2022-32533/CVE-2022-33980/CVE-2021-37839)
关于后台动态模板添加内容的总结 Builder使用
比尔·盖茨晒48年前简历:“没你们的好看”
CTFshow,信息搜集:web7
Cvpr2022 | backdoor attack based on frequency injection in medical image analysis
智汀不用Home Assistant让小米智能家居接入HomeKit
PyTorch模型训练实战技巧,突破速度瓶颈
What is the process of ⼀ objects from loading into JVM to being cleared by GC?
Jetson AGX Orin CANFD 使用
防火墙基础之服务器区的防护策略
Find your own value