For the Jvm field descriptors, as this link says: https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.2
It uses Z to describe boolean type, J for long and L for class instance.
Anyone knows why?
I mean I noticed that B has already used by byte, but why use Z for boolean? why not use L for long and R for reference?
I am not sure if you will get an authoritative answer, however.
J
is sometimes used in other contexts to be wider than I
as it is the next letter (similarly H
for half int/short, or the previous letter to I)L
for language data structure?Z
for a letter which won't be used for anything else. c.f. Z
is used for "Zulu" or GMT time as a default time.BTW They could have used b
for boolean as the JVM is case sensitive.
If you look at the details of the byte code, many choices seem ad hoc, and in hindsight might have been done better, but at the time Java was very new and it wasn't at all clear it would be as popular as it is.