Member-only story

Kotlin for Android Development: A Complete Beginner’s Guide 🚀

Jayant Kumar🇮🇳
7 min read2 days ago

--

Photo by Louis Tsai on Unsplash

In this article we will see a complete beginner’s guide to start with the Android Development.

🚀 Variables

In kotlin variables are declared using val , var and const keywords

🔴 val

Variables declared with val cannot be reinitialised further , it should be initialised at the time of declaration.

val name:String = "Jayant"

If we try to re-initialised then we will get the compile time error.

🔴 var

Variables declared with var can be reinitialised later.

 var name1 = "Jayant"
name1 = "Mohan"

🔴 const

const keyword is used to declare constant values, if the value is fixed , not dynamic then we should declare variables with const .

const val name = "Hello const value"
const val PI = 3.14

🚀 Data Types

We can also define the data type to each variables , so that it does not accept any other type.

🔴 String

   val name:String = "Jayant"

🔴 Int

 val num:Int = 12

--

--

Jayant Kumar🇮🇳
Jayant Kumar🇮🇳

Written by Jayant Kumar🇮🇳

Hello My name is Jayant Kumar, I am a software Engineer , specialist in Mobile Development (Android , IOS , Flutter , React Native and Ionic) from India 🇮🇳

No responses yet