当前位置:网站首页>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);
}
}
边栏推荐
- [today in history] July 7: release of C; Chrome OS came out; "Legend of swordsman" issued
- asp. Netnba information management system VS development SQLSERVER database web structure c programming computer web page source code project detailed design
- In the field of software engineering, we have been doing scientific research for ten years!
- word中删除一整页
- 一文读懂数仓中的pg_stat
- electron remote 报错
- 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
- Instructions for mictr01 tester vibrating string acquisition module development kit
- What is cloud primordial? This time, I can finally understand!
- WebRTC 音频抗弱网技术(上)
猜你喜欢
AWS学习笔记(三)
CTFshow,信息搜集:web1
#yyds干货盘点# 解决名企真题:交叉线
AWS learning notes (III)
C 6.0 language specification approved
Yyds dry goods inventory # solve the real problem of famous enterprises: cross line
什么是云原生?这回终于能搞明白了!
Apache多个组件漏洞公开(CVE-2022-32533/CVE-2022-33980/CVE-2021-37839)
Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
Computer win7 system desktop icon is too large, how to turn it down
随机推荐
leetcode:648. Word replacement [dictionary tree board + find the shortest matching prefix among several prefixes]
Instructions for mictr01 tester vibrating string acquisition module development kit
Cvpr2022 | backdoor attack based on frequency injection in medical image analysis
ES日志报错赏析-maximum shards open
Applet directory structure
PG基础篇--逻辑结构管理(锁机制--表锁)
Niuke real problem programming - Day12
Bill Gates posted his resume 48 years ago: "it's not as good-looking as yours."
Wechat applet - Advanced chapter component packaging - Implementation of icon component (I)
JS image to Base64
一款你不容错过的Laravel后台管理扩展包 —— Voyager
Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
In the field of software engineering, we have been doing scientific research for ten years!
15、文本编辑工具VIM使用
Today's sleep quality record 78 points
⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?
数据湖(九):Iceberg特点详述和数据类型
Discussion on CPU and chiplet Technology
AWS learning notes (III)
Lidar Knowledge Drop