𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Fundamental Kotlin: revised, Third Edition

✍ Scribed by MilosVasic


Publisher
Independently published
Year
2023
Tongue
English
Leaves
480
Edition
3
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Learn the fundamentals of the Kotlin programming language quickly and easily!Kotlin is new statically typed programming language running on the Java Virtual Machine, Android, browser, or native. By reading this book you will be able to quickly start work on your first Kotlin project.

Today Kotlin is the main programming language for Android development. Thanks to its popularity Kotlin became the language for any other JVM development. For example, many backend developers are using Kotlin for Spring application We are all witnesses of the increasing number of Kotlin communities, conferences and workshops that have been held, many books that have been written, and demand for various software components. Many of these components have been ported from Java and some of them continued their development only in pure Kotlin.

Kotlin is powerful. Everything that we did in Java can be raised to a completely new level. Kotlin a tool for everything, a general-purpose first-class programming What you will get from Kotlin is less stress, fever bugs, and more joy while working the best job in the world, begin software engineer!

Where Kotlin can be used? You can use Kotlin to develop your web server, to write various programming libraries, or for example to write plugins. To get into Kotlin read this book carefully, use internet and most write as much code as you can!

Who is this book for?
This book is for people who are willing to try something new. Fundamental Kotlin revised (third edition of Fundamental Kotlin book serial) is imagined not just as a guide to Kotlin for experienced but also for students or technology So, you are not a senior developer it should not be a problem. However, some fundamentals of computing are assumed. The should be familiar with some programming fundamentals, with Git basics and bash shell basic commands.

✦ Table of Contents


Table of Contents

About β€œFundamental” book serial 8

What is different compared to the Second Edition? 9

What is this book about? 9

Who is this book for? 9

Fonts used in this book 9

Ubuntu 9

JetBrains Mono 10

About the author 11

Preface 12

What is Kotlin? 13

Some basic concepts explained 14

What is a statically typed programming language? 14

What is Java Virtual Machine or JVM? 14

Java bytecode 14

Basic characteristics of Kotlin 15

Where is it used? 16

Server-side development 16

Android mobile development 16

JavaScript development 17

Native development 17

Kotlin for data science 17

Building programs 20

Installing Kotlin compiler 20

SDKMAN 20

Homebrew 20

MacPorts 21

Compiling Kotlin source code 21

Kotlin to JavaScript 23

Using library 23

Kotlin/Native 24

Installing Kotlin/Native 24

Compiling to native 25

Build automation tools 26

Gradle 26

Maven 27

Apache Ant 27

Griffon 27

Kobalt 28

Creating Kotlin project 29

Creating IDE project 30

Kotlin and Gradle 30

Creating Gradle project 34

Converting Java source code to Kotlin 36

Fundamentals 38

A short history of Java 39

What is Java? 41

Java Runtime Environment 42

What is JVM? 42

What is the Java ecosystem? 43

How Kotlin relates to Java? 43

Lifecycle of the program 43

Basic syntax 45

The lexical structure of Kotlin programs 46

Packages and code organization 51

Importing source code 53

The statements and expressions 54

Constants and variables 56

Working with functions 58

Passing arguments to functions 59

Default arguments 60

Working with exceptions 61

Throwable 62

Try / Catch / Finally block 64

The most frequently used exception types 67

Data type fundamentals 68

Numbers in Kotlin 68

Characters in Kotlin 71

Booleans in Kotlin 72

Arrays 73

Strings in Kotlin 75

String templates 77

Nullability 78

Multiple assignment 84

Type checks and smart casts 85

Operators and expressions 89

Equality 89

Arithmetic operators 90

Assignment operators 92

Unary operators 93

Increment and decrement operators 94

Comparisons 95

Logical operators 96

Operator overloading 98

Conditional expressions 100

If expression 101

When 103

Classes 110

Constructors 111

Secondary constructors 113

Class members 114

Class properties 114

Inheritance 117

Overriding 119

Object-oriented features 121

Data classes 121

Abstraction 123

Object 125

Class companion object 126

Interfaces 133

Properties in Interfaces 137

Interfaces Inheritance 138

Overriding conflicts 139

Functional interfaces 141

Nested classes 142

Inner classes 143

Functions 144

Invoke 145

Higher-order functions 145

Named arguments 147

Single-Expression functions 149

Variable argument functions 150

Spread operator 151

Local functions 153

Infix functions 154

Tail-recursive functions 155

Anonymous functions 156

Inline Functions 157

Lambdas 158

Closures 161

Control flow 161

If expression 162

Loops 163

For 163

While loop 166

Do / While loop 167

Ranges 168

Jump expressions 171

Break operator 171

Continue operator 171

Jump operator labels 172

Return with labels 173

Collections 176

Immutable lists 177

Immutable maps 182

Immutable sets 187

Mutable collections 193

Traversing 196

Predicates 197

Mapping 199

Flattening 200

Combining β€œmap” and β€œflatMap” 201

Finding maximum and minimum 203

Sorting 204

Sum 204

Grouping 205

Partitioning 205

Folding 206

References 207

Strong references 208

Memory leaks 209

Weak references 213

Soft references 215

Phantom references 216

References summary 216

Atomic references 217

This reference 219

Generic data types 220

Generic functions 222

Generics wildcards 224

Enumeration 225

Sealed classes 229

Annotations 231

Annotation constructors 233

Lambdas in annotations 234

Arrays in annotations 234

Most frequently used annotations 234

How to use annotations 235

Any 238

Unit 239

Nothing 239

Visibility modifiers 241

Extensions 243

Extending class properties 245

Extending objects 246

Extension function literals 248

Scope functions 249

This and It 250

Scope functions return value 250

β€œLet” scope function 251

β€œWidth” scope function 252

β€œRun” scope function 253

β€œApply” scope function 254

β€œAlso” scope function 255

β€œtakeIf” and β€œtakeUnless” 256

Singleton pattern in Kotlin 257

Lazy initialization 258

Properties with late initialization 260

Delegating behavior 261

Delegating properties 262

Property delegation requirements 264

Observable 265

Builders 266

String builder 266

Map builders 267

Destructuring 268

Mapped properties 269

Concurrency 269

Threads 270

Thread execution 273

Coroutines 275

Coroutine scope building 277

Coroutine job 278

Summary 281


πŸ“œ SIMILAR VOLUMES


Fundamental Neuroscience, Third Edition
✍ Larry R. Squire, Darwin Berg, Floyd Bloom, Sascha du Lac, Anirvan Ghosh πŸ“‚ Library πŸ“… 2008 🌐 English

Fundamental Neuroscience, 3rd Edition introduces graduate and upper-level undergraduate students to the full range of contemporary neuroscience. Addressing instructor and student feedback on the previous edition, all of the chapters are rewritten to make this book more concise and student-friendly t

Intermolecular and Surface Forces, Third
✍ Jacob N. Israelachvili πŸ“‚ Library πŸ“… 2011 πŸ› Academic Press 🌐 English

This reference describes the role of various intermolecular and interparticle forces in determining the properties of simple systems such as gases, liquids and solids, with a special focus on more complex colloidal, polymeric and biological systems. The book provides a thorough foundation in theorie

Intermolecular and Surface Forces, Third
✍ Jacob N. Israelachvili πŸ“‚ Library πŸ“… 2011 πŸ› Academic Press 🌐 English

This reference describes the role of various intermolecular and interparticle forces in determining the properties of simple systems such as gases, liquids and solids, with a special focus on more complex colloidal, polymeric and biological systems. The book provides a thorough foundation in theorie

Fundamentals of Aerodynamics,Third Editi
✍ John D. Anderson πŸ“‚ Library πŸ“… 2001 🌐 English

In keeping with the successful previous edition, Anderson carries over the second edition content into the third edition, while adding selected topics and examples.

Fundamentals of Psychopharmacology, Thir
✍ Brian E. Leonard(auth.) πŸ“‚ Library πŸ“… 2001 🌐 English

Treatment with drugs is fundamental to modern therapy of psychiatric disorders. The number of disorders responsive to drug treatment is increasing, reflecting the extensive synthesis of novel compounds and the greater understanding of the aetiology of the disorders. <p> This third edition provides n