Update 3. 数组中重复的数字.md

This commit is contained in:
WeeNews 2019-12-24 20:43:56 +08:00 committed by GitHub
parent 5f005e2263
commit 977082ceeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,11 @@ private void swap(int[] nums, int i, int j) {
nums[j] = t;
}
```
**`补充:`**
(1)boolean不是占1位计算机处理处理数据的最小单元是1字节一般1位的话其余7位会被0补齐
(2)在java虚拟机规范中JVM没有用于操作boolean的字节码指令在编译后用int的数据类型代替boolean此时boolean占4字节
(3)boolean[]数组编译后会被byte[]数组代替此时的boolean占1字节
总结:boolean单独存在占4字节在boolean[]中占1字节