Kotlin Learning (2) -- basic syntax function variables, string template conditional expressions, null, type detection, for, while, when, range, set, kotlinnull
Author:Liu Ren programmer
Blog:Http://blog.csdn.net/qq_26787115
Statement: Do not reprint without the permission of the original author
1. Basic syntax
Many concepts of Kotlin are similar to those of JAVA, so I should not
It's as detailed as my JA
Original title: Functional operations over views in ViewGroup using KotlinOriginal link: http://antonioleiva.com/functional-operations-viewgroup-kotlin/Original Antonio Leiva (http://antonioleiva.com/about/)Published in the original: 2015-07-29Collections, iterations, arrays, sequences ... All of these share a useful set of functions that help transform, sort, and manipulate their elements . However, due to the way the class is constructed, some funct
Release Android Function Energy (I): Lambda expressions in the Kotlin language, kotlinlambda
Original article title: Unleash functional power on Android (I): Kotlin lambdas
Link: http://antonioleiva.com/operator-overloading-kotlin/
Antonio Leiva (http://antonioleiva.com/about)
Original article published:
Although Java 8 already contains some functional tools,
Antonio LeivaTime:APROriginal link:https://antonioleiva.com/unit-tests-android-kotlin/of course, Kotlin and allows us to do unit testing in a very simple way. , it's very similar to our Java in the same way. when we use to Mockito Library When there are some small complications, however, we will see some tricks to make it easier. unit tests for KotlinAlthough the single test topic is always controversial
Kotlin Learning (2) -- basic syntax, function, variable, string template, conditional expression, null, type detection, for, while, when, interval, set, kotlinnull1. Basic syntax
Many concepts of Kotlin are similar to those of JAVA, so I should not be as detailed as I did on my JAVA journey, but don't worry, you will understand it, I also learned from official documents.
Create a project Kotlin02 in IDEA1.
Original title: Converting Plaid to Kotlin:lessons learned (Part 2)Original link:http://antonioleiva.com/plaid-kotlin-2/Original Antonio Leiva (http://antonioleiva.com/about/)Published in the original: 2015-11-17The significant improvements that we see in the first section are attributed to the use of the Kotlin language in the activity. However, due to the fact that the main overloaded methods do something
Original title: Unleash Functional Power on Android (I): Kotlin lambdasOriginal link:http://antonioleiva.com/operator-overloading-kotlin/Original Antonio Leiva (http://antonioleiva.com/about/)Published in the original: 2015-08-05While Java 8 already contains some functional tools, and as you might imagine, Android developers are not able to use these tools immediately (and perhaps not at all), functional pr
Tags: ICA compile exp directory already check version today/etc/Kotlin is the future of the JVM world, whether you believe it or not, I believed it anyway!Well, if you're not confused, just follow me and learn, haha.A moment to downloadHttps://github.com/JetBrains/kotlin/releases/download/v1.1.51/kotlin-compiler-1.1.51.zipWget–no-check-certificate \Https://github
How to implement static methods like Java or C # in Kotlin, this paper summarizes several methods, including package-level functions, associated objects, extension functions, and object declarations. This requires people to choose according to different circumstances.
You can find a lot of such articles on the Internet, the official recommendation is the package-level function, also some people say with the associated object (companion Class). These
Forty-eight practical Android skills: Java8 and kotlin on Android
Java and Android are also in the dark.Things in the technical circle are often led by commercial interests.This is the only thing in the world.Java 8
Currently, Android Application Development has been applied to Java 7, but its support for Java 8 is still far away.Java 8 provides many good features for new technology practitioners.Lambda expressions, Stream API, Date Time API, and conc
Kotlin android Extension: Goodbye to findViewById (KAD 04), kotlinfindviewbyid
By Antonio Leiva
Time: Dec 12,201 6
Link: http://antonioleiva.com/kotlin-android-extensions/
You may be tired of using findViewById to write Android views day after day. Or you may discard it and use the famous Butterknife library. Then you will love Kotlin's Android extension.
Kotlin
Kotlin is integrated with the Android SDK (KAD 05) and kotlinandroid
By Antonio Leiva
Time: Dec 19,201 6
Link: https://antonioleiva.com/kotlin-integrations-android-sdk/
Using the Kotlin language not only simplifies your code, but also simplifies calling Java code from Kotlin.
How does this work? Using some common st
Use Kotlin to perform function operations on ViewGroup views.
Original article title: Functional operations over Views in ViewGroup using Kotlin
Link: http://antonioleiva.com/functional-operations-viewgroup-kotlin/
Antonio Leiva (http://antonioleiva.com/about)
Original article published:
Set, iteration, array, sequence... all these share a set of usefulFunctio
Function-based Android programming (II): Set Operations in the Kotlin language, androidkotlin
Original article title: Functional Android (II): Collection operations in Kotlin
Link: http://antonioleiva.com/collection-operations-kotlin/
Antonio Leiva (http://antonioleiva.com/about)
Original article published:
Lambda expressions are an outstanding tool to simplify
In Java, you can use {} to create an anonymous block of code, and the code block will be executed normally, and it doesn't seem to have any effect other than changing the scope. But it is not possible to do so in Kotlin.In fact, we all know that a function must be associated with a memory address, and an anonymous block of code is actually an anonymous function. In Kotlin, you typically use the run function to run an anonymous block of code.As follows
Kotlin Native, kotlinnative
Kotlin Native is not a concept of Jni. It does not only need to interact with underlying Code such as C and C ++, but also needs to bypass the Jvm to directly compile the machine code for the system to run. That is to say, Kotlin is about to discard the Java crutches!
In fact, when I first saw the Native name, I naturally thought of
Who said the interface cannot have code? -- Kotlin interface introduction (KAD 26), kotlinkad
By Antonio Leiva
Time: Jun 6, 2017
Link: https://antonioleiva.com/interfaces-kotlin/
Compared with Java, the Kotlin interface allows you to reuse more code.
The reason is very simple:You can add code to your interface. If you have tried Java 8, this is very similar.
Google announced at this year's I/O developers conference that the Kotlin language should be used as the first-level programming language of Android development. Kotlin is developed by JetBrains, interoperable with Java 100%, and has many new features that Java does not yet support. So you know what Kotlin is? If you do not know that then hurriedly own Baidu.
ab
optional when the return type can be inferred by the compiler.fun double(x:Int)=x*2Explicitly specifying the return typeWhen a function has a block of code, it must explicitly indicate the return type, which is not explicitly specified if it is returned to the unit. Kotlin cannot infer the return type when the function has a block of code, because there is a complex flow of control in the code, and the return type is not intuitive to the reader.Non-q
Kotlin is a new JVM-based language that can be seen as the extended language of Java, developed by JetBrains, who first saw him in the company's Android team when they saw them using the Kotlin to develop Android, suddenly feeling curious, and then slowly studied the prophecy.Why to develop and use the Kotlin language, the official saying is:Concise safeversatile
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.