当前位置:网站首页>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);
}
}
边栏推荐
- CPU与chiplet技术杂谈
- Read PG in data warehouse in one article_ stat
- Protection strategy of server area based on Firewall
- Computer win7 system desktop icon is too large, how to turn it down
- Shengteng experience officer Episode 5 notes I
- Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
- 拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条...
- word中删除一整页
- Mlgo: Google AI releases industrial compiler optimized machine learning framework
- 解析PHP跳出循环的方法以及continue、break、exit的区别介绍
猜你喜欢
时空可变形卷积用于压缩视频质量增强(STDF)
CTFshow,信息搜集:web12
Niuke real problem programming - day15
[Yugong series] go teaching course 005 variables in July 2022
用于增强压缩视频质量的可变形卷积密集网络
比尔·盖茨晒48年前简历:“没你们的好看”
智汀不用Home Assistant让小米智能家居接入HomeKit
MicTR01 Tester 振弦采集模塊開發套件使用說明
Stm32cubemx, 68 sets of components, following 10 open source protocols
8大模块、40个思维模型,打破思维桎梏,满足你工作不同阶段、场景的思维需求,赶紧收藏慢慢学
随机推荐
激光雷達lidar知識點滴
Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
Introduction and use of Kitti dataset
Ffmpeg --- image processing
「2022年7月」WuKong编辑器更版记录
Full details of efficientnet model
Cocoscreator resource encryption and decryption
MicTR01 Tester 振弦采集模块开发套件使用说明
C 6.0 language specification approved
Base64 encoding
Instructions d'utilisation de la trousse de développement du module d'acquisition d'accord du testeur mictr01
Attribute keywords serveronly, sqlcolumnnumber, sqlcomputecode, sqlcomputed
关于后台动态模板添加内容的总结 Builder使用
潘多拉 IOT 开发板学习(HAL 库)—— 实验12 RTC实时时钟实验(学习笔记)
广州开发区让地理标志产品助力乡村振兴
AWS learning notes (III)
Several ways of JS jump link
缓冲区溢出保护
【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
6、Electron无边框窗口和透明窗口 锁定模式 设置窗口图标