I was reading about the Java 8 features and I saw that they have method references, but I did not see how to specify which method when the method is overloaded. Does anyone know?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Compiler will match the method signature with the functional interface.
Essentially,
f2
is something that can accept anInteger
and return aNumber
, the compiler can find out that the 2ndfoo()
meets the requirement.From this Lambda FAQ:
So, you'll need to cast it if there are ambiguous signatures.