Chapter 1

  1. Kotlin's popularity has skyrocketed in recent months due to the fact that it is a simple and concise language that is easy to learn and supports object-oriented and functional programming. Kotlin is a superset of Java that avoids all unwanted Java features, such as verbose, unsafe, and outdated syntax, and includes powerful features from different languages. These features include security, simplicity, and interoperability.
  2. Type inference is a mechanism where the Kotlin compiler plays its role in establishing the type of variable. Kotlin will determine the data type by understanding the value assigned. It intelligently infers the type by the value, and then makes the data type variable respectively.
  3. Null ability is one of the reasons that most applications crash. Kotlin is very strict when it comes to safety. When it comes to applications, users, especially mobile users, desire a nice, simple, and smooth user experience. In Kotlin, variables are non-nullable by default and you cannot assign null values to them.
  4. Kotlin allows specification of the argument's name in a function call. This approach makes the function call more readable and it reduces the chances of passing an incorrect value to the variable, especially when all variables have the same data type.
  5. Package-level functions are declared within the Kotlin class and can be accessed directly by using the package name as a reference.
  6. Kotlin allows a name to be assigned to the loop so that when loop termination is required, a break statement can call the labeled loop to terminate it.

..................Content has been hidden....................

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