Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the array type [J in java

Tags:

java

arrays

We are well familiar with the standard primitive array types, e.g:

[I // array of integer
[L // array of Long
[D // array of Double
[Ljava.lang.Object   // array of Object

But what is

[J

Cluster assignments: = 2 -> [J@4fe42c88,1 -> [J@d27bdb2,0 -> [J@2c16f7dd

UPDATE So I had misread the output for [L : that is for a Class/Interface - I had thought it were for a long. Instead J is for the Long (as shown in the first answer)

like image 638
WestCoastProjects Avatar asked Dec 25 '22 23:12

WestCoastProjects


1 Answers

From the docs

Element Type        Encoding
long                J
...

i.e. its an array of long primitives

like image 114
Reimeus Avatar answered Dec 28 '22 08:12

Reimeus