We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a2cc64c commit 78d7035Copy full SHA for 78d7035
src/main/kotlin/me/kotlindemo/03_extensions.kt
@@ -17,10 +17,12 @@ fun main() {
17
val randy = "Randy!"
18
19
/**
20
+ * Extension functions allow us to add features to 3rd party stuff (types)
21
* Receiver type is the class getting extended, ie 'String' in this example
- * this fun returns a type 'Sring'
22
+ * this fun returns a type 'String'
23
* this will show up in autocomplete
- * ingore intellij warning for now about String. receiver param not used
24
+ * ignore intellij warning for now about String. receiver param not used
25
+ * can be invoked from java but kinda messy
26
*/
27
fun String.doodify() : String = "doood!" //adds the fun 'doodify' to all string objects in this module, can use block body too
28
0 commit comments