当前位置:网站首页>1-4 decimal representation and conversion
1-4 decimal representation and conversion
2022-06-27 07:27:00 【WayserKON】
Hexadecimal said
- Octal and hexadecimal representation .
public class Main {
public static void main(String[] args){
int x = 0x1f; // Hexadecimal
System.out.println(x); // output: 31
x = 0x1F;
System.out.println(x); // output: 31
x = 070; // octal
System.out.println(x); // output: 56
long y = 0x1f;
System.out.println(y); // output: 31
y = 0x1F;
System.out.println(y); // output: 31
y = 070;
System.out.println(y); // output: 56
}
}
Hexadecimal conversion
- Binary and decimal conversion
public class Main {
public static void main(String[] args){
String str = Long.toBinaryString(7);
System.out.println(str); // output: 111
long x = Long.parseLong("111", 2);
System.out.println(x); // output: 7
}
}
- Octal and decimal conversion
public class Main {
public static void main(String[] args){
String str = Long.toOctalString(63);
System.out.println(str); // output: 77
long x = Long.parseLong("77", 8);
System.out.println(x); // output: 31
}
}
- Hexadecimal and decimal conversion
public class Main {
public static void main(String[] args){
String str = Long.toHexString(15);
System.out.println(str); // output: f
long x = Long.parseLong("1F", 16);
System.out.println(x); // output: 31
}
}
边栏推荐
猜你喜欢

【Kevin三连弹之三】Rust真的比C慢吗?进一步分析queen微测评

Vs how to configure opencv? 2022vs configuration opencv details (multiple pictures)

面试官:用分库分表如何做到永不迁移数据和避免热点问题?

Interviewer: how to never migrate data and avoid hot issues by using sub database and sub table?

使用 Blackbox Exporter 测试网络连通性

语音信号特征提取流程:输入语音信号-分帧、预加重、加窗、FFT->STFT谱(包括幅度、相位)-对复数取平方值->幅度谱-Mel滤波->梅尔谱-取对数->对数梅尔谱-DCT->FBank->MFCC
![[graduation season] graduation is the new beginning of your life journey. Are you ready](/img/4e/aa763455da974d9576a31568fc6625.jpg)
[graduation season] graduation is the new beginning of your life journey. Are you ready

用XGBoost迭代读取数据集

面试官:请你介绍一下缓存穿透、缓存空值、缓存雪崩、缓存击穿的,通俗易懂

SQL 注入绕过(一)
随机推荐
解决 Win10 Wsl2 IP 变化问题
如何优雅的写 Controller 层代码?
boundvalueops和opsforvalue区别
多表联查--07--- Hash join
Date database date strings are converted to and from each other
Difference between boundvalueops and opsforvalue
RNA SEQ data analysis in R - investigate differentially expressed genes in the data!
Talk about Domain Driven Design
2022 CISP-PTE(二)SQL注入
How to write controller layer code gracefully?
Rust Async: smol源码分析-Executor篇
Coggle 30 Days of ML 7月竞赛学习
Optimistic and pessimistic affairs
How to implement redis cache of highly paid programmers & interview questions series 116? How do I find a hot key? What are the possible problems with caching?
Transaction overview of tidb
POI export excle
2022 cisp-pte (I) document contains
What is the difference between volatile and synchronized?
剑指 Offer 07. 重建二叉树
从5秒优化到1秒,系统飞起来了...