Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

how to use ToStringBuilder.reflectionToString to get contents of arrayList

$
0
0

I want to get contents of arrayList using reflection, but I am only getting the arrayList object instead of arrayList values with reflectionToString. Below is the sample code and output:

   ArrayList<String> nodeList = new ArrayList<String>();   nodeList.add("Inpt1");   nodeList.add("Inpt2");   System.out.println(ToStringBuilder.reflectionToString(nodeList,  ToStringStyle.MULTI_LINE_STYLE));   Output:   java.util.ArrayList@5ca881b5[   size=2   ]

Can you tell me a way to get the contents of ArrayList with reflectionToString?


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>