Lambda A/B #1

 
1. Consider this API:

interface IntIntMapper { // function from int to int
public int map(int i);
}

class ArrayOfIntegers { // collection-like bag of ints
void replaceAll(IntIntMapper mapper);
}


We want to express "double each number in the collection". Here is one possible lambda syntax that does this.

array.replaceAll( i => 2*i );

Which of the following statements best describes your feeling about this syntax?
Powered by SurveyMonkey
Check out our sample surveys and create your own now!