forked from mouredev/hello-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVariablesAndConstants.java
More file actions
37 lines (25 loc) · 833 Bytes
/
VariablesAndConstants.java
File metadata and controls
37 lines (25 loc) · 833 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package basic.c01_beginner;
/*
Clase 2 - Comentarios, Variables, Constantes, Tipos de datos y Operadores (09/04/2025)
Vídeo: https://www.twitch.tv/videos/2428998601
*/
public class VariablesAndConstants {
public static void main(String[] args) {
// Variables
String name = "Brais";
System.out.println(name);
name = "MoureDev";
System.out.println(name);
// name = 37; Error (no podemos cambiar el tipo de dato)
int age = 37;
System.out.println(age);
System.out.println(email);
var year = 2025;
System.out.println(year);
// Constantes
// EMAIL = "[email protected]"; Es constante
System.out.println(EMAIL);
}
}