当前位置:网站首页>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);
}
}
边栏推荐
- CTFshow,信息搜集:web7
- Apache多个组件漏洞公开(CVE-2022-32533/CVE-2022-33980/CVE-2021-37839)
- Pandora IOT development board learning (HAL Library) - Experiment 12 RTC real-time clock experiment (learning notes)
- Applet directory structure
- JSON parsing instance (QT including source code)
- 上半年晋升 P8 成功,还买了别墅!
- JS image to Base64
- Andriod --- JetPack :LiveData setValue 和 postValue 的区别
- Attribute keywords serveronly, sqlcolumnnumber, sqlcomputecode, sqlcomputed
- 拜拜了,大厂!今天我就要去厂里
猜你喜欢

Niuke real problem programming - day15

Full details of efficientnet model

Five pain points for big companies to open source

Stm32cubemx, 68 sets of components, following 10 open source protocols

拜拜了,大厂!今天我就要去厂里

大厂做开源的五大痛点

Discussion on CPU and chiplet Technology

13 ux/ui/ue best creative inspiration websites in 2022

Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?

Novel Slot Detection: A Benchmark for Discovering Unknown Slot Types in the Dialogue System
随机推荐
Cocoscreator operates spine for animation fusion
Simple steps for modifying IP of sigang electronic scale
Applet directory structure
JSON解析实例(Qt含源码)
Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
Apache多个组件漏洞公开(CVE-2022-32533/CVE-2022-33980/CVE-2021-37839)
PAG体验:十分钟完成AE动效部署上线各平台!
Base64 encoding
寺岗电子称修改IP简易步骤
13 ux/ui/ue best creative inspiration websites in 2022
CTFshow,信息搜集:web7
Novel Slot Detection: A Benchmark for Discovering Unknown Slot Types in the Dialogue System
FFmpeg----图片处理
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
一文读懂数仓中的pg_stat
Ffmpeg --- image processing
CTFshow,信息搜集:web8
Find your own value
Used by Jetson AgX Orin canfd
Apache multiple component vulnerability disclosure (cve-2022-32533/cve-2022-33980/cve-2021-37839)