2018-05-09 16:10:08 +00:00
|
|
|
import java.lang.String;
|
2017-05-31 15:10:50 +00:00
|
|
|
|
|
|
|
public class Lambda2
|
|
|
|
{
|
|
|
|
public static void main(List<String> args){
|
2017-09-25 21:47:38 +00:00
|
|
|
var listOfStrings = new List<String>();
|
|
|
|
var listOfObjects;
|
2017-06-12 16:57:12 +00:00
|
|
|
listOfObjects = map(listOfStrings, (a) -> a);
|
2017-05-31 15:10:50 +00:00
|
|
|
}
|
2017-06-12 16:57:12 +00:00
|
|
|
|
|
|
|
public map(a , b){
|
|
|
|
b.apply(a);
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2017-05-31 15:10:50 +00:00
|
|
|
/*
|
|
|
|
public static <I,O> List<O> map(List<I> input, Function<I,O> func) {
|
|
|
|
List<O> output;
|
|
|
|
output = new List<O>();
|
|
|
|
output.add(func.apply(input.get()));
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
class List<A>{
|
|
|
|
A get();
|
|
|
|
void add(A);
|
|
|
|
}
|
|
|
|
|
|
|
|
class Function<A,B>{
|
|
|
|
B apply(A a);
|
|
|
|
}
|