Netbeans has a variable tab that appears when debugging. It works great for for example booleans as I see the name of the variable and its value (e.g. "true") and Strings (as I see e.g. "Dog") but I in the case of arrays, for example an array of Strings, I see something like #57(length=13) but would like to see its contents i.e. {"a", "b", "c", "d"}. Is this possible in Netbeans?
-
1I haven't used Netbeans, but I'd expect arrays to just be expandable to see their contents - like a directory in a file explorer...Jon Skeet– Jon Skeet2016-02-21 12:45:35 +00:00Commented Feb 21, 2016 at 12:45
-
You're right - there is a tiny "+" sign I haven't seen. Thanks.Richard Smith– Richard Smith2016-02-21 12:54:09 +00:00Commented Feb 21, 2016 at 12:54
4 Answers
A very old question, but I've found an easy solution for Netbeans 12.0.
When debugging, in the Variables tab, right-click on the table's header (for example Value header), and check String value: String representation of the value.
A new column String value will be added with the toString() value.
Comments
u can use the "Expression Evaluation" windows. It's less comfortable then "Variables" window but still helpful. to get this windows go to "WIndows" --> "Debugging" --> "Expression Evaluation".
there if you have, for example, array of type "items_t" called "items" , u just type "items[0]" and it shows you all what inside that index.
I still have not managed to find out how to print the whole array.