You need an ArrayList , in which there are instances of the class, take and translate all its contents into a string. How can I do that?
- override the toString method of the class, and then just call it on the necessary class instances. if you need the entire collection, do it in a loop. - Dmitry
|
2 answers
Override the class's toString() method, as you need, and call ArrayList 'a toString() .
|
List<String> list = objectList.stream().map(Object::toString).collect(toList()); C syntax could be wrong.
- 3Android streams are available with api24, which is actually equal to their absence, since no one develops so far just for the latest actual api (android 7), such devices, conventionally, are units. - pavlofff
|