当前位置:网站首页>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
}
}
边栏推荐
- vs怎么配置OpenCV?2022vs配置OpenCV详解(多图)
- pytorch Default process group is not initialized
- Manim math engine
- Classical cryptosystem -- substitution and replacement
- OPPO面试整理,真正的八股文,狂虐面试官
- Difference between boundvalueops and opsforvalue
- 【Kevin三连弹之三】Rust真的比C慢吗?进一步分析queen微测评
- JDBC操作Mysql示例
- Park and unpark in unsafe
- R 中的 RNA-Seq 数据分析 - 调查数据中的差异表达基因!
猜你喜欢

(已解决) MINet 进行测试时报错如下 raise NotImplementedError
![[Kevin's third play in a row] is rust really slower than C? Further analyze queen micro assessment](/img/ac/44e0ecd04fbea5efd39d2cc75dea59.jpg)
[Kevin's third play in a row] is rust really slower than C? Further analyze queen micro assessment

Oppo interview sorting, real eight part essay, abusing the interviewer

C# 请问怎么在更新数据库时候调用line与rows

如何优雅的写 Controller 层代码?

Machine learning

一线大厂面试官问:你真的懂电商订单开发吗?

Goodbye, agile Scrum

进程终止(你真的学会递归了吗?考验你的递归基础)

(已解决) npm突然报错 Cannot find module ‘D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js‘
随机推荐
1-4 进制表示与转换
NoViableAltException([email protected][2389:1: columnNameTypeOrConstraint : ( ( tableConstraint ) | ( columnNameT
Manim math engine
一个人管理1000台服务器?这款自动化运维工具一定要掌握
Centos7.9 install MySQL 5.7 and set startup
SQL考勤查询间隔一小时
(resolved) NPM suddenly reports an error cannot find module 'd:\program files\nodejs\node_ modules\npm\bin\npm-cli. js‘
YOLOv6又快又准的目标检测框架 已开源
高薪程序员&面试题精讲系列116之Redis缓存如何实现?怎么发现热key?缓存时可能存在哪些问题?
JDBC事务提交事例
Process termination (have you really learned recursion? Test your recursion Foundation)
jupyter notebook文件目录
Guava scheduled task
mssql如何使用语句导出并删除多表数据
Some settings about postfix completion code template in idea
【LeetCode】Day90-二叉搜索树中第K小的元素
2022 CISP-PTE(一)文件包含
Origin of forward slash and backslash
Bean拷贝详解
RNA SEQ data analysis in R - investigate differentially expressed genes in the data!