-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1498 from deiiviitdev/main
#00 - Kotlin
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/kotlin/deiiviitdev.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// https://kotlinlang.org/ | ||
|
||
// One line comment | ||
|
||
/* | ||
Multiple line comment | ||
*/ | ||
|
||
/** | ||
* This is a documentation comment | ||
*/ | ||
|
||
val drink = "Cafe" | ||
const val dish = "Pizza" | ||
|
||
|
||
/** | ||
* Basic types | ||
*/ | ||
// Integer types | ||
val one: Int = 1 | ||
val threeBillions: Long = 3000000000 | ||
val oneByte: Byte = 1 | ||
val oneShort: Short = 1 | ||
|
||
// Floating point types | ||
val pi: Float = 3.14f | ||
val e: Double = 2.71828 | ||
|
||
// Unsigned types | ||
val oneUByte: UByte = 1u | ||
val oneUShort: UShort = 1u | ||
val oneUInt: UInt = 1u | ||
val oneULong: ULong = 1u | ||
|
||
// Boolean type | ||
val isTrue: Boolean = true | ||
|
||
// Character type | ||
val a: Char = 'a' | ||
|
||
// String type | ||
val hello: String = "Hello" | ||
|
||
// Array type | ||
val oneToFive: Array<Int> = arrayOf(1, 2, 3, 4, 5) | ||
val oneToFive2: IntArray = intArrayOf(1, 2, 3, 4, 5) | ||
|
||
/** | ||
* Print "Hola, Kotlin" to the console | ||
*/ | ||
fun main() { | ||
println("Hola, Kotlin") | ||
} |