Search This Blog
This blog is about Programming. You will find all the concepts with it's example. You can find example of different functions with it's explanation.
Featured
- Get link
- X
- Other Apps
Kotlin : Characters and Strings
In this post will talk about 2 important datatype of Kotlin that are Characters and String. These datatype are often used in Kotlin
Character Datatype in Kotlin
Character is one of the datatype in kotlin. As name suggest with this datatype you can store characters in Kotlin.
var firstAlphabet : Char = ‘A’
String Datatype in Kotlin
A set or group of character is known as String. It is used for storing the text value.
var sampleString = “Hello World” // specify the data type of string like this var anotherString : String = “Hello”
String values are presented between “ “ (double quotes). With this kotlin can get idea that user want to store a string type value on this particular variable.
If you don’t want to assign the value of string variable at the time of assignment then you need to specify the datatype of variable like this :
var stringWithoutValue:String stringWithoutValue = “Some value”
Popular Posts
JavaScript : Get Started with JavaScript
- Get link
- X
- Other Apps
Comments
Post a Comment