Author: saqibkhan
-
Kotlin Comment
Comments are the statements that are used for documentation purpose. Comments are ignored by compiler so that don’t execute. We can also used it for providing information about the line of code. There are two types of comments in Kotlin. Single line comment Single line comment is used for commenting single line of statement. It…
-
Kotlin Standard Input/Output
Kotlin standard input output operations are performed to flow byte stream from input device (keyboard) to main memory and from main memory to output device (screen). Kotlin Output Kotlin output operation is performed using the standard methods print() and println(). Let’s see an example: Output The methods print() and println() are internally call System.out.print() and System.out.println() respectively. Difference…
-
Kotlin Operator
Operators are special characters which perform operation on operands (values or variable).There are various kind of operators available in Kotlin. Arithmetic Operator Arithmetic operators are used to perform basic mathematical operations such as addition (+), subtraction (-), multiplication (*), division (/) etc. Operator Description Expression Translate to + Addition a+b a.plus(b) – Subtraction a-b a.minus(b) *…
-
Kotlin Type Conversion
Type conversion is a process in which one data type variable is converted into another data type. In Kotlin, implicit conversion of smaller data type into larger data type is not supported (as it supports in java). For example Int cannot be assigned into Long or Double. In Java In Kotlin However in Kotlin, conversion…