luohzzz

导航

2021年4月29日 #

类、对象(oop)

摘要: ```javapublic class oopDemo6Student { String name; int age; public void study(){ System.out.println(this.name+"在学习"); }}//person >名字、生日、身高、体重//类(抽象) > 阅读全文

posted @ 2021-04-29 17:52 luohzzz 阅读(54) 评论(0) 推荐(0) 编辑

值传递、引用传递

摘要: public class oopDemo4 { public static void main(String[] args) { //java属于值传递 int a =1; System.out.println(a); change(a); System.out.println(a);//这里输出a 阅读全文

posted @ 2021-04-29 17:48 luohzzz 阅读(20) 评论(0) 推荐(0) 编辑

方法调用

摘要: public class oopDemo2 { public static void main(String[] args) { new oopDemoStudent().say();//调用非静态方法要用new实例化, return; } //oopDemoStufent2().say1(); / 阅读全文

posted @ 2021-04-29 17:45 luohzzz 阅读(43) 评论(0) 推荐(0) 编辑

方法定义回顾

摘要: public class oopDemo1 { public static void main(String[] args) { }//方法定义的回顾 /* 修饰符 返回值类型 方法名(参数){ 方法体 return 返回值; } */ public String LUO(){ return "lu 阅读全文

posted @ 2021-04-29 17:41 luohzzz 阅读(42) 评论(0) 推荐(0) 编辑

2021年4月24日 #

递归

摘要: 递归 package ff;​public class Dome6 { public static void main(String[] args) { System.out.println(f(4)); } public static int f(int n){ if (n==1); return 阅读全文

posted @ 2021-04-24 22:33 luohzzz 阅读(32) 评论(0) 推荐(0) 编辑

可变参数

摘要: 可变参数 package ff;​public class Dome4 { public static void main(String[] args) { Dome4 dome4 = new Dome4(); dome4.test(1);​ } public void test(int...i){ 阅读全文

posted @ 2021-04-24 22:07 luohzzz 阅读(16) 评论(0) 推荐(0) 编辑

方法

摘要: 方法 什么是方法 System.out.println() package ff;​import com.sun.org.apache.xerces.internal.impl.dv.xs.AbstractDateTimeDV;​public class Dome1 {//main方法 public 阅读全文

posted @ 2021-04-24 17:32 luohzzz 阅读(265) 评论(0) 推荐(0) 编辑

2021年4月22日 #

break、continue

摘要: package ds;​public class Dome14 { public static void main(String[] args) { int i =0; while (i<100){ i++; System.out.println(i); if (i==30);{ break; } 阅读全文

posted @ 2021-04-22 22:36 luohzzz 阅读(45) 评论(0) 推荐(0) 编辑

switch

摘要: switch switch(111){ case '222': // break; case '333': // break; default: //} package ds;​import java.util.Scanner;​public class Dome7 { public static 阅读全文

posted @ 2021-04-22 14:48 luohzzz 阅读(35) 评论(0) 推荐(0) 编辑

if

摘要: if单 if (br表达式){//如果br表达式为true将输出的 package ds;​import java.util.Scanner;​public class Dome4 { public static void main(String[] args) { Scanner scanner 阅读全文

posted @ 2021-04-22 14:19 luohzzz 阅读(298) 评论(0) 推荐(0) 编辑