Usually the first, I don’t remember ever using a constructor with a trailing {…} block (took me a few seconds to parse what was going on)
☝️ 1
araqnid
05/28/2020, 9:46 AM
although if A is an interface with a single method, can’t it now be satisfied by a lambda? (I know that used to be just for Java SAM interfaces, but I thought it had been extended to Kotlin ones too)
➕ 3
m
Matteo Mirk
05/28/2020, 9:50 AM
If understand correctly you’re choosing between two styles to implement the Strategy pattern?
e
Eugen Martynov
05/28/2020, 10:37 AM
it is scroll listener class for pagination, it calculates when next page should be loaded and call the abstract function