Update Java 基础.md

读到boolean的size为什么不确定时有疑问,感觉没有说透,加个link来展开解释一下对其他人可能有帮助。
This commit is contained in:
Yingjie Liu 2023-04-27 09:51:27 +08:00 committed by GitHub
parent 2c31eddf34
commit 2bf370c5fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,7 @@
boolean 只有两个值true、false可以使用 1 bit 来存储但是具体大小没有明确规定。JVM 会在编译时期将 boolean 类型的数据转换为 int使用 1 来表示 true0 表示 false。JVM 支持 boolean 数组,但是是通过读写 byte 数组来实现的。
- [Why is Java's boolean primitive size not defined?] (https://stackoverflow.com/questions/1907318/why-is-javas-boolean-primitive-size-not-defined)
- [Primitive Data Types](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html)
- [The Java® Virtual Machine Specification](https://docs.oracle.com/javase/specs/jvms/se8/jvms8.pdf)