Say I want to copy all elements of list A into list B. But the elements in list A are of type ExampleClass and elements in list B are String.
ExampleClass {
String a;
}
Since ExampleClass has an attribute a which is a String, when converting from ExampleClass to String I want the value of a to be returned as the String that represents ExampleClass. Would toString() do this? What's the most efficient way of doing this without having to loop through all of list A, convert each ExampleClass into String, and adding them to list B?