Skip to content
Advertisement

Why VSCode shows strange “@number” (like int[10]@9) for arrays when debugging?

This was a simple binary search code and while I was debugging it for my better understanding, I got this remark a = int[10]@9 in the debugging panel – what does it mean (especially “@9” part after the type)? int[10]@9 remark while debugging

JavaScript

Advertisement

Answer

By default, the debugger shows the toString() value of an object. As arrays don’t override the toString() method, it just uses the default implementation inherited from Object.

As the documentation says here, the string is constructed in the following way:

JavaScript

So, that’s exactly what you’re seeing: the class name, the ‘@’ symbol, and the hash code.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement