摘要: public class D{ //成员变量 int k = 200; //主方法:入口 public static void main(String[] args){ //i变量就是局部变量 //int i = 10; System.out.println(i); } //成员变量 static 阅读全文
posted @ 2021-08-24 00:05 沉默的言兴与誉 阅读(39) 评论(0) 推荐(0)
摘要: public class B { public static void main(String[] args) { int i = 100; System.out.println(i); //100 i = 200; System.out.println(i); //200 //以下代码顺序有错误, 阅读全文
posted @ 2021-08-23 23:09 沉默的言兴与誉 阅读(23) 评论(0) 推荐(0)
摘要: public class A{ public static void main(String[] args) { //声明一个int类型的变量,起名i int i; //编译报错:变量i并没有初始化 //System.out.println(i); //给i变量赋值,i变量在这 i = 100; S 阅读全文
posted @ 2021-08-23 22:57 沉默的言兴与誉 阅读(23) 评论(0) 推荐(0)