output the values in an array


I am going through below example

ArrayUtils.toString() is a great way to display the values of simple data types. For more complex data types, like JavaBeansW, you can use ArrayUtils.toString() in conjunction with ToStringBuilder.reflectionToString() in the toString() method of your complex data type to display the values of your objects in your array.

I have not understood what author meant by above line.

please advise
Any links resources ideas highly appreciated. Thanks in advance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sharon SethCommented:
It mans it is a great way to use ToStringBuilder.reflectionToString() in toString() to print your array of complex types .
zzynxSr. Software engineerCommented:
For arrays of simple data types you can use ArrayUtils.toString() and that gives you the expected result "by default".

For complex data types (classes), you have to override the toString() method of those classes.
i.e. exactly specify how you want the string representation of an instance of your complex class to look like.

The sentence you don't understand states, that in the latter case, you can use ToStringBuilder.reflectionToString() in that toString() method code you write.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gudii9Author Commented:
in this link where they used

ToStringBuilder.reflectionToString() in that toString() method code you write.

Any other links to understand this concept better
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

zzynxSr. Software engineerCommented:
>> where they used
In the class TestClass.

public String toString() {
    return "\n" + ToStringBuilder.reflectionToString(this);

Open in new window

gudii9Author Commented:
the ArrayTest class contains an inner class called TestClass.

I wonder why author used inner class in this case. please advise
zzynxSr. Software engineerCommented:
In this (simple) case TestClass could have been perfectly a "global" class too.

When should inner classes be used in Java?
gudii9Author Commented:
I wonder what  is a need for inner class even after reading the link you posted.
zzynxSr. Software engineerCommented:
That article gives a nice example. I can't do any better. Sorry.
zzynxSr. Software engineerCommented:
Thanx 4 axxepting
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.