2 Star 0 Fork 0

热门极速下载/hello-java

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Extras.java 1012 Bytes
一键复制 编辑 原始数据 按行查看 历史
package basic.c10_extras;
/*
Clase 8 - Manejo de excepciones, depuración y extras (28/05/2025)
Vídeo: https://www.twitch.tv/videos/2471305243
*/
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);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_trending/hello-java.git
git@gitee.com:mirrors_trending/hello-java.git
mirrors_trending
hello-java
hello-java
main

搜索帮助