Neat way of doing stuff with a List (and such) in Java -


in c# can operations on list, this:

return mylist.average(p => p.getvalue()); 

this returns average of values. there similar in java? (that save me calculation of sum , division number of elements?)

thanks!

lambdaj provides functionality this:

double totalage = sumfrom(persons).getage(); //divide size average 

http://code.google.com/p/lambdaj/wiki/lambdajfeatures


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -