Arrays in Kotlin

Two main ways to create array in kotlin. Helper function arrayOf() and constructor Array() .  details of arrayOf() function

to access any element of this array we need to write myArray[index] to get specific value.

It is noted that in array you can assign different data type value . for example

To enforce that all… Read More »

loop in Kotlin

Similar with any other language  loop in kotlin . for loop while loop do while loop basic for loop example

this loop is equivalent of java for loop

note:  in Kotlin if you want to access variable inside double quotation use $ sign to access this variable . While Loop

do while loop 


Conditional Statement in Kotlin (if, when)

at first write a simple program then discuss

this program we read input from user in command line and convert it in Integer . In kotlin readLine() function is used to get input from command line . If else condition in Kotlin is same in any other language . inside if block condition true then enter if block… Read More »

Type Conversion in Kotlin

Here I write 2  line of code . Both are number but the first number is non fractional number. In kotlin non fraction number built in type is Integer . but you wonder why its not byte , short , long . this example second line is a fractional number its default data type is double as… Read More »

Important Notes about basic concent of Kotlin

#Basics You do not need ; to break statements. Comments are similar to Java or C#, /* This is comment */ for multi line comments and // for single line comment. Unlike Java, you do not need to match your file name to your class name. Like JavaScript, you can create functions outside classes. So there is no… Read More »

Data Types in Kotlin

Data Types in Kotlin As you know, a variable is a location in memory (storage area) to hold data. In this section, we are going to learn basic topic data types in kotlin: numbers, characters, booleans, arrays, and strings. Bitwise operators left shift, right shift, unsigned right shift, logical and, logical or and exclusive logical or – are supported… Read More »

Defining Variable in Kotlin

Two type of keyword is used to defile a variable in Kotlin . these are val (immutable) var (mutable)

immutable : That means  you can not change the value . Assign value only one time . Its similar constant variable in strongly type language line c#, JAVA . If you uncomment this line program show compile type… Read More »

Kotlin Vs Java

Kotlin Vs Java This part we try to find out similarity and difference between Kotlin and Java . Java is world most popular language and its the official language of Android Development. Google I/O conference was a big announcement that Kotlin is the ??latest/new  programming language for Android Application Development. Java & Kotlin both are feasible programming languages. In our… Read More »

Kotlin Hello World

Kotlin Hello World This is kotlin programming language Series Tutorial. Here i have tried to use kotlin latest version. Today we will learn how to setup Intellij IDEA to print “hello world” in Kotlin. Steps: 1st step: Open Intellij IDEA then click create new project 2nd Step: Select Gradle from left side and select Java (not needed) & Kotlin… Read More »