• Complain

Hani M K - Exploring Kotlin

Here you can read online Hani M K - Exploring Kotlin full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2019, publisher: leanpub.com, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Exploring Kotlin
  • Author:
  • Publisher:
    leanpub.com
  • Genre:
  • Year:
    2019
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Exploring Kotlin: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Exploring Kotlin" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Hani M K: author's other books


Who wrote Exploring Kotlin? Find out the surname, the name of the author of the book and a list of all author's works by series.

Exploring Kotlin — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Exploring Kotlin" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Exploring Kotlin Syntax features capabilites Hani M K This book is for sale - photo 1
Exploring Kotlin
Syntax, features & capabilites
Hani M K

This book is for sale at http://leanpub.com/exploring-kotlin

This version was published on 2019-11-30

This is a Leanpub book Leanpub empowers authors and publishers with - photo 2

* * * * *

This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do.

* * * * *

2019 Hani M K

Thank you for downloading Exploring Kotlin.

This book is dedicated for those who spent a good amount of their career writing Java! Finally, here is a language that makes you be yourself :)

The first version of this book, is a result of individual effort. Writing this mini book was a good way to explore Kotlin. I hope reading it does the same thing too.

Your comments and suggestions are welcome.

Please, feel free to contact and follow if you like.

  • Email: hmkcode@gmail.com
  • Github: github.com/hmkcode
  • Twitter: twitter.com/hmkcode
  • Blog: hmkcode.com

Hani M. K.

CHAPTER 1 | Getting Started
  • This chapter will cover the basic syntax of Kotlin and will introduce some of the tools used for coding in Kotlin.
1.1 | Tools
  • There are many tools that will help you start coding in Kotlin.
  • Tools listed below shall cover the needs for most Kotlin learners to start coding in Kotlin.
  • Based on your goal from learning Kotlin, you may use one or more of these tools.
  • In this book we will mainly be using Kotlin online playground.
Kotlin playground
  • Kotlin Playground is an online sandbox to explore Kotlin.
  • The playground is the easiest way to start exploring Kotlin.
1funmain(){2println("Hello, world!!!")3}
IntelliJ IDEA
  • IntelliJ IDEA is the preferred IDE for developing projects in Kotlin.
  • Kotlin is bundled with IntelliJ IDEA. It has all what you need to start coding in Kotlin.
  • You can download the free Community Edition
  • You can follow the steps in this tutorial from Kotlin official site Getting Started with IntelliJ IDEA
Android studio
  • Android Studio fully supports Kotlin.
  • You can create a new project with Kotlin-first support, add Kotlin files to existing project with Java files or converting existing Java to Kotlin.
1.2 | Kotlin Basic Syntax
main() function
  • The starting point for running Kotlin app is main() function.
1funmain(){2println("Hello world!")3}
val & var variables
  • Read-only variables should be defined with val
  • Variables that can be updated or changed is defined as var
  • Variables must either have a type annotation or be initialized
1valw:Int=0// immediate assignment2valx=6// type `Int` is inferred "no type provided"3valy:Int// Type is required "no initial value"4y=7// deferred assignment "Type of y defined before"5valz=3// this is OK67z=z+1// This is an error "Val cannot be reassigned"89varcounter=0// this variable can be updated10counter++;
Comments
  • Comments can be added in Kotlin as following
1// single line comment23/* Multi-line4comments */
String templates
  • String template is a neat way to build a dynamic string.
1funmain(){2varn=13println("n = $n")4valresult="n is ${if(n > 0) "positive" else "notpositive"}"5println(result)6}

Output:

1 n = 12 n is positive
  • Notice: Kotlin expression inside the curly brackets.
Functions fun
  • Functions is a block of reusable code that is used to perform an action and may return result.
  • Functions are declared using fun keyword.
  • Functions may take variables or even other functions as parameters.
1funmultiply(a:Int,b:Int):Int{2returna*b3}
  • Function with expression body and inferred return type can be written as:
1funmultiply(a:Int,b:Int)=a*b
  • Function parameters can have default values.
1funmultiply(a:Int=2,b:Int=4)=a*b
  • Function with no return value use Unit as return type which can be also omitted.
1funprintResult(a:Int,b:Int):Unit{23println("result = "+multiply(a,b))45}
if & when Control Flow
  • if
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Exploring Kotlin»

Look at similar books to Exploring Kotlin. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Exploring Kotlin»

Discussion, reviews of the book Exploring Kotlin and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.