From 2bf370c5fa7905b63fa4b0441a9452f83883990e Mon Sep 17 00:00:00 2001 From: Yingjie Liu <50257589+yingjil@users.noreply.github.com> Date: Thu, 27 Apr 2023 09:51:27 +0800 Subject: [PATCH] =?UTF-8?q?Update=20Java=20=E5=9F=BA=E7=A1=80.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 读到boolean的size为什么不确定时有疑问,感觉没有说透,加个link来展开解释一下对其他人可能有帮助。 --- "notes/Java \345\237\272\347\241\200.md" | 1 + 1 file changed, 1 insertion(+) diff --git "a/notes/Java \345\237\272\347\241\200.md" "b/notes/Java \345\237\272\347\241\200.md" index b0da53a397..4968176eb3 100644 --- "a/notes/Java \345\237\272\347\241\200.md" +++ "b/notes/Java \345\237\272\347\241\200.md" @@ -57,6 +57,7 @@ boolean 只有两个值:true、false,可以使用 1 bit 来存储,但是具体大小没有明确规定。JVM 会在编译时期将 boolean 类型的数据转换为 int,使用 1 来表示 true,0 表示 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)