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

http://jdk8.java.net/lambda/

with can write lambdas line p -> p.getprice() , function references myclass::mymethod

http://docs.oracle.com/javase/tutorial/java/javaoo/lambdaexpressions.html


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -