Question about method references

David Alayachew davidalayachew at gmail.com
Sat Nov 29 19:42:26 UTC 2025


And to simplify the question, is it possible for me to create some function
foo that can do this?

record User(String firstName, String lastName) {}
java.lang.reflect.Method getFirstName = foo(User::firstName);

Or better yet, like this?

java.lang.reflect.RecordComponent getLastName = foo(User::lastName);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20251129/8e13bbe3/attachment.htm>


More information about the core-libs-dev mailing list