Scala Find Method Syntax -


val underlying: mongodbcollection def find(doc: dbobject): dbcursor = underlying find doc 

here's hypothetical program. apparently valid implementation of find method, don't understand how method body underlying find doc produce value. how find method evaluate doc parameter, , how underlying variable affecting anything? why not find doc underlying or find doc method body?

when method takes 1 parameter, can omit both prefix . , brace () when calling method on object.

underlying find doc 

is same

underlying.find(doc) 

it calls find method on mongodbcollection instance underlying doc parameter.


Comments

Popular posts from this blog

angularjs - Showing an empty as first option in select tag -

qt - Change color of QGraphicsView rubber band -

c++ - Visible files in the "Projects" View of the Qt Creator IDE if using the CMake build system -