Explain the java b symbol.

446    Asked by AlGerman in Java , Asked on Oct 13, 2022

 I look at java bytecode and understand almost everything.

I saw the symbol [B on java bytecode.

What does it mean?

Answered by Amanda Hawes

Java b means a byte array.


In the Java descriptor syntax, a [ at the beginning means an array. There's a one letter code for each primitive type - B = Byte, C = Char, S = Short, Z = Boolean, I = Int, J = Long, F = Float, and D = Double. Object types are represented by L, followed by the classname, followed by a semicolon.
So for example, a String[][][] would have the descriptor [[[Ljava/lang/String;.


Your Answer

Interviews

Parent Categories