当前位置:网站首页>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);
}
}
边栏推荐
- 2022云顾问技术系列之高可用专场分享会
- 属性关键字ServerOnly,SqlColumnNumber,SqlComputeCode,SqlComputed
- What is the process of ⼀ objects from loading into JVM to being cleared by GC?
- electron remote 报错
- 8大模块、40个思维模型,打破思维桎梏,满足你工作不同阶段、场景的思维需求,赶紧收藏慢慢学
- Instructions for mictr01 tester vibrating string acquisition module development kit
- Yyds dry goods inventory # solve the real problem of famous enterprises: cross line
- EMQX 5.0 发布:单集群支持 1 亿 MQTT 连接的开源物联网消息服务器
- "July 2022" Wukong editor update record
- 用于增强压缩视频质量的可变形卷积密集网络
猜你喜欢
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
在软件工程领域,搞科研的这十年!
#yyds干货盘点# 解决名企真题:交叉线
In the field of software engineering, we have been doing scientific research for ten years!
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条...
Apache多个组件漏洞公开(CVE-2022-32533/CVE-2022-33980/CVE-2021-37839)
asp.netNBA信息管理系统VS开发sqlserver数据库web结构c#编程计算机网页源码项目详细设计
「2022年7月」WuKong编辑器更版记录
Jetson AGX Orin CANFD 使用
电脑Win7系统桌面图标太大怎么调小
随机推荐
leetcode:648. 单词替换【字典树板子 + 寻找若干前缀中的最短符合前缀】
Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
Bill Gates posted his resume 48 years ago: "it's not as good-looking as yours."
leetcode:648. Word replacement [dictionary tree board + find the shortest matching prefix among several prefixes]
Niuke real problem programming - day15
关于后台动态模板添加内容的总结 Builder使用
属性关键字OnDelete,Private,ReadOnly,Required
In the field of software engineering, we have been doing scientific research for ten years!
CTFshow,信息搜集:web10
暑期安全很重要!应急安全教育走进幼儿园
Stm32cubemx, 68 sets of components, following 10 open source protocols
CTFshow,信息搜集:web5
The world's first risc-v notebook computer is on pre-sale, which is designed for the meta universe!
Used by Jetson AgX Orin canfd
word中删除一整页
Protection strategy of server area based on Firewall
数据库如何进行动态自定义排序?
华为云数据库DDS产品深度赋能
"July 2022" Wukong editor update record
【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例