当前位置:网站首页>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);
}
}
边栏推荐
- 什么是云原生?这回终于能搞明白了!
- ⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?
- Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
- CTFshow,信息搜集:web13
- CTFshow,信息搜集:web12
- 15、文本编辑工具VIM使用
- Navigation — 这么好用的导航框架你确定不来看看?
- Stm32cubemx, 68 sets of components, following 10 open source protocols
- JSON解析实例(Qt含源码)
- Apache multiple component vulnerability disclosure (cve-2022-32533/cve-2022-33980/cve-2021-37839)
猜你喜欢

用于增强压缩视频质量的可变形卷积密集网络

Promoted to P8 successfully in the first half of the year, and bought a villa!

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

暑期安全很重要!应急安全教育走进幼儿园

【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例

上半年晋升 P8 成功,还买了别墅!

Because the employee set the password to "123456", amd stolen 450gb data?

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

Niuke real problem programming - Day12

Full details of efficientnet model
随机推荐
Navigation — 这么好用的导航框架你确定不来看看?
Niuke real problem programming - day14
asp. Netnba information management system VS development SQLSERVER database web structure c programming computer web page source code project detailed design
Niuke real problem programming - day13
Demis hassabis talks about alphafold's future goals
JSON parsing instance (QT including source code)
比尔·盖茨晒48年前简历:“没你们的好看”
Cocoscreator resource encryption and decryption
Deformable convolutional dense network for enhancing compressed video quality
"July 2022" Wukong editor update record
WebRTC 音频抗弱网技术(上)
Pandora IOT development board learning (HAL Library) - Experiment 12 RTC real-time clock experiment (learning notes)
Instructions d'utilisation de la trousse de développement du module d'acquisition d'accord du testeur mictr01
Jetson AGX Orin CANFD 使用
JSON解析实例(Qt含源码)
什么是云原生?这回终于能搞明白了!
2022 cloud consulting technology series high availability special sharing meeting
CTFshow,信息搜集:web1
Protection strategy of server area based on Firewall
Half an hour of hands-on practice of "live broadcast Lianmai construction", college students' resume of technical posts plus points get!