Importing extension functions

Just as with any other type, extension functions have to be imported if they won't be used. Our isPowerOf2 extension is defined in the quickstart.kotlin.extensions package, so we'd import it in the file where we want to use it:

import quickstart.kotlin.extensions.isPowerOf2
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.200.106