-
Notifications
You must be signed in to change notification settings - Fork 343
Expand file tree
/
Copy pathExtras.java
More file actions
54 lines (35 loc) · 960 Bytes
/
Extras.java
File metadata and controls
54 lines (35 loc) · 960 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package basic.c10_extras;
/*
Clase 74 - Extras
Vídeo: https://youtu.be/JOAqpdM36wI?t=30409
*/
import basic.c08_oop.Classes;
import basic.c08_oop.Person;
import java.util.Scanner;
//import basic.c08_oop.*;
public class Extras {
static String globalName = "mouredev";
public static void main(String[] args) {
// Extras
// null
String name = "Brais";
name = null;
if (name != null) {
System.out.println(name.toLowerCase());
}
// import
new Person("Brais", 18, "1");
new Classes();
// Scanner
var scanner = new Scanner(System.in);
System.out.println("Introduce tu edad: ");
var age = scanner.nextInt();
System.out.println("La edad es: " + age);
// Scope: variables globales y locales
test();
// static
}
public static void test() {
System.out.println(globalName);
}
}