- Kotlin Standard Library Cookbook
- Samuel Urbanowicz
- 71字
- 2021-07-23 19:05:54
Getting ready
We can declare extension functions and extension properties inside any file in the project. However, to keep them well organized, it's better to put them in dedicated files.
The syntax for extension functions is very similar to the one of the standard function. We just need to add information about the type that is being extended with the new function, as follows:
fun SomeClass.newFunctionName(args): ReturnType {
// body
}
推薦閱讀
- 演進(jìn)式架構(gòu)(原書第2版)
- Getting Started with React
- VSTO開發(fā)入門教程
- MySQL數(shù)據(jù)庫管理與開發(fā)實(shí)踐教程 (清華電腦學(xué)堂)
- 網(wǎng)絡(luò)爬蟲原理與實(shí)踐:基于C#語言
- PhoneGap:Beginner's Guide(Third Edition)
- iOS自動(dòng)化測試實(shí)戰(zhàn):基于Appium、Python與Pytest
- UNIX Linux程序設(shè)計(jì)教程
- Arduino Wearable Projects
- 計(jì)算機(jī)應(yīng)用技能實(shí)訓(xùn)教程
- Mudbox 2013 Cookbook
- Robot Framework Test Automation
- After Effects CC案例設(shè)計(jì)與經(jīng)典插件(視頻教學(xué)版)
- Test-Driven iOS Development with Swift
- 系統(tǒng)分析師UML用例實(shí)戰(zhàn)