gudii9
asked on
output the values in an array
Hi,
I am going through below example
http://www.avajava.com/tutorials/lessons/whats-a-quick-way-to-output-the-values-in-an-array.html?page=2
I have not understood what author meant by above line.
please advise
Any links resources ideas highly appreciated. Thanks in advance
I am going through below example
http://www.avajava.com/tutorials/lessons/whats-a-quick-way-to-output-the-values-in-an-array.html?page=2
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
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>> where they used
In the class TestClass.
Method:
In the class TestClass.
Method:
public String toString() {
return "\n" + ToStringBuilder.reflectionToString(this);
}
ASKER
the ArrayTest class contains an inner class called TestClass.
I wonder why author used inner class in this case. please advise
In this (simple) case TestClass could have been perfectly a "global" class too.
When should inner classes be used in Java?
When should inner classes be used in Java?
ASKER
I wonder what is a need for inner class even after reading the link you posted.
That article gives a nice example. I can't do any better. Sorry.
Thanx 4 axxepting
ASKER
Any other links to understand this concept better