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

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -