I have a feeling that Google can respond quickly if I know the Java terminology for what I want to do, but I do not do this, so in trust, I trust. :)
I have an Object s vector, and I want the array from String contain the string representation of each element in the vector generated by calling toString() for each element.
In Ruby (or Perl, or Python, or Scheme, or any of millions of other languages ββusing the map method) here, how would I do this:
vector.map(&:to_s) do |string| # do stuff end
How can I make an equivalent in Java? I would like to write something like this:
Vector<Object> vector = ...; String[] strings = vector.map(somethingThatMagicallyCallsToString);
Any ideas?
source share