当前位置:网站首页>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);
}
}
边栏推荐
- Cvpr2022 | backdoor attack based on frequency injection in medical image analysis
- 智汀不用Home Assistant让小米智能家居接入HomeKit
- Bill Gates posted his resume 48 years ago: "it's not as good-looking as yours."
- 拜拜了,大厂!今天我就要去厂里
- How does the database perform dynamic custom sorting?
- Used by Jetson AgX Orin canfd
- Full details of efficientnet model
- WebRTC 音频抗弱网技术(上)
- Niuke real problem programming - Day9
- Niuke real problem programming - Day12
猜你喜欢

Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched

什么是云原生?这回终于能搞明白了!

EfficientNet模型的完整细节

IDA pro逆向工具寻找socket server的IP和port

Niuke real problem programming - Day11

How to enable radius two factor / two factor (2fa) identity authentication for Anheng fortress machine

CTFshow,信息搜集:web9

Webrtc audio anti weak network technology (Part 1)

WebRTC 音频抗弱网技术(上)

Navigation — 这么好用的导航框架你确定不来看看?
随机推荐
asp.netNBA信息管理系统VS开发sqlserver数据库web结构c#编程计算机网页源码项目详细设计
Es log error appreciation -trying to create too many buckets
Cocoscreator resource encryption and decryption
13 ux/ui/ue best creative inspiration websites in 2022
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
Concurrency Control & NoSQL and new database
一文读懂数仓中的pg_stat
Instructions for mictr01 tester vibrating string acquisition module development kit
C# 6.0 语言规范获批
CPU与chiplet技术杂谈
[server data recovery] a case of RAID data recovery of a brand StorageWorks server
8大模块、40个思维模型,打破思维桎梏,满足你工作不同阶段、场景的思维需求,赶紧收藏慢慢学
PD虚拟机教程:如何在ParallelsDesktop虚拟机中设置可使用的快捷键?
Several ways of JS jump link
「2022年7月」WuKong编辑器更版记录
ES日志报错赏析-maximum shards open
Used by Jetson AgX Orin canfd
Lidar knowledge drops
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条...
Find your own value