티스토리 뷰

지식쌓기

SAM Conversion

바나나쥬스 2020. 2. 11. 10:18

SAM-Conversion이란?

This is possible when the required type is an interface or abstract class with a Single (exactly one) Abstract Methods. Such a class is sometypes called a SAM-type, and the conversion from a lambda expression to an anonymous class is sometimes called SAM-conversion.

http://www.gnu.org/software/kawa/Anonymous-classes.html

 

Kawa: Anonymous classes

Syntax: object (supers ...) field-or-method-decl ... Lambda as shorthand for anonymous class An anonymous class is commonly used in the Java platform where a function language would use a lambda expression. Examples are call-back handlers, events handlers,

www.gnu.org