Kotlin~Functional programming Two brushes: higher-order functions and lambda expressions

1.introduce What is a higher-order function? A function that takes a function as a parameter or returns a function is called a higher-order function. With lambda in the function, the function of the function belongs to the higher order function. The function of java has existing output followed by input, and the function of kt has input follow ...

Posted on Tue, 21 Sep 2021 12:42:50 -0400 by pattyb

Imitation wechat chat fried "shit" effect!! Ah, just play!

Long Long Ago, wechat 8.0 has updated a new function of "frying shit", which is quite new. Chatting with friends these two days triggered this function. At that time, I thought, ah! Isn't this article material coming?! Take advantage of the weekend to realize it. Let's take a look at the overall implementation effect: This articl ...

Posted on Sun, 12 Sep 2021 15:07:52 -0400 by omniuni

Kotlin study notes

Blow a wave first   Kotlin execution process Variables and constants Common data types Hello World case fun main() { // var is used to declare variables; str is the variable name, followed by ":" separated from the variable type; String is a variable type, var str: String = "Hello World" printl ...

Posted on Fri, 10 Sep 2021 04:25:46 -0400 by iblackedout

Kotlin jigsaw puzzle, it's embarrassing if you can't play it, [Android interview question]

So there should be a class to store these information. inner class PictureBlock { var bitmap: Bitmap; var postion: Int = 0 var left = 0; var top = 0; constructor(bitmap: Bitmap, postion: Int, left: Int, top: Int) { this.bitmap = bitmap this.postion = postion this.left = left this.top = top ...

Posted on Mon, 06 Sep 2021 22:28:23 -0400 by keiron77

Kotlin learning notes is a must for beginners

} @Api("repos") interface Repos { @Get("{owner}/{repo}/forks") fun forks(owner: String, repo: String) } } object RetroApi { const val PATH_PATTERN = """(\{(\w+)\})""" val okHttp = OkHttpClient() val gson = Gson() val enclosing = { cls: Class<*> -> var currentCls: Class<*>? = cls sequen ...

Posted on Mon, 06 Sep 2021 21:54:25 -0400 by danelkayam