functional programming - A reference to a method in java -
i've been playing around functional programing little , suspect it's got me. there's i'd able in java , i'm not sure if can done.
i have object 'ob' of type 'a'. have library of methdods (several thousand, automatically generated ones-that take same arguments) might want attach ob. i'd able write
a ob = new a(someint, someint, method mymethod);
and able write (within a) along lines of)
x = mymethod.call(arg1, arg2);
is there in java let's me this? or have stayed far light?
what need java 8 lambda support. else ugly. (even java has functional support nothing true functional language) suggest try
with can write lambdas line p -> p.getprice()
, function references myclass::mymethod
http://docs.oracle.com/javase/tutorial/java/javaoo/lambdaexpressions.html
Comments
Post a Comment