摘要: 变量 作用域 常量 public class Dome06 { public static void main(String[] args) { //int a,b,c; //int a=1,b=2,c=3;(可在一行,但不建议,尽量多行去写) //定义变量 int a = 1; int b = 2 阅读全文
posted @ 2025-07-10 14:47 A那就算了吧 阅读(11) 评论(0) 推荐(0)
摘要: 类型转换 public class Demo04 { public static void main(String[] args) { int i =128; byte b = (byte)i;//内存溢出 //强制转换 (类型)变量名 高--低 //自动转换 低--高 System.out.pri 阅读全文
posted @ 2025-07-10 14:46 A那就算了吧 阅读(5) 评论(0) 推荐(0)
摘要: 数据类型扩展和面试题 public class Demo03 { public static void main(String[] args) { //整数拓展 进制 二进制 十进制 八进制 十六进制 int i=10; int i2=010;//八进制0 int i3=0x10;//十六进制0x 阅读全文
posted @ 2025-07-10 14:46 A那就算了吧 阅读(4) 评论(0) 推荐(0)
摘要: 八大数据类型 public class Demo02 { public static void main(String[] args) { /*String a="hello"; int num=10; System.out.println(a); System.out.println(num);* 阅读全文
posted @ 2025-07-10 14:46 A那就算了吧 阅读(12) 评论(0) 推荐(0)
摘要: 注释、标识符和关键字 public class HelloWorld { public static void main(String[] args) { //单行注释 //输出一个Hello,World! //String teacher ="秦疆"; System.out.println("He 阅读全文
posted @ 2025-07-10 14:45 A那就算了吧 阅读(20) 评论(0) 推荐(0)