where is scala get() method been defined -


def twosum(param1: list[int], param2: int) = {     val gb = ((param1 combinations 2 tolist) find (_.sum == param2) get)     val gb2 = gb map (param1.indexof(_)) sorted     val index1 = gb2(0)+1     val index2 = gb2(1)+1     println(s" index1 = ${index1}, index2 = ${index2}") } 

in code, it's using @ second line. question scala get() method been defined.

thanks

find returns option.

you therefore calling get method of option class.


Comments

Popular posts from this blog

how to do line continuation in perl debugger for entering raw multi-line text (EOT)? -

javascript - Create websocket without connecting -

android - Linear layout children not scrolling -