What does the class class [B represents in Java?

前端 未结 2 819
渐次进展
渐次进展 2020-12-23 16:16

I am trying out a tool jhat here to test my java memory usage. It reads in a heap dump file and prints out information as html. However, the tables shows as follows:

相关标签:
2条回答
  • Those are arrays of primitives ([B == byte[], [C == char, [I == int). [Lx; is an array of class type x.

    For a full list:

    [Z = boolean
    [B = byte
    [S = short
    [I = int
    [J = long
    [F = float
    [D = double
    [C = char
    [L = any non-primitives(Object)
    

    Also see the Javadoc for Class.getName.

    0 讨论(0)
  • 2020-12-23 16:44

    Looks like an array of characters (C)/bytes (B)/ints (I).

    0 讨论(0)
提交回复
热议问题