can we convert list to string in java code example
Example 1: java list of strings to string
String string = list.stream().map(Object::toString).collect(Collectors.joining(""));
Example 2: list to string
# Python program to convert a list
# to string using list comprehension
s = ['I', 'ate', 2, 'shake', 'and', 3, 'chocolates']
# using list comprehension
listToStr = ' '.join([str(element) for element in s])
print(listToStr)