From 684faa3b0b298630b6d777f8eabd2fe410438c09 Mon Sep 17 00:00:00 2001 From: SalatielGenol Date: Sat, 15 Oct 2022 08:14:02 +0200 Subject: [PATCH] =?UTF-8?q?A=C3=B1adidas=20constantes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kotlin.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kotlin.md b/kotlin.md index 2a4822f..5de2ee3 100644 --- a/kotlin.md +++ b/kotlin.md @@ -14,7 +14,7 @@ */ ``` -#### Declaración e inicialización de variables +#### Variables Se debe usar siempre la inferencia de tipos, aunque se pueda asignar el tipo de variable. La inicialización aquí es obligatoria. @@ -26,4 +26,10 @@ var nombreVariable: Float|Double 1.1[F] var nombreVariable: Boolean = true var nombreVariable: Char = 'a' var nombreVariable: String = "qwerty" +``` + +#### Constantes + +```kotlin +val nombreConstante[:tipo] = valor ``` \ No newline at end of file