摘要:
public class interfases { public static void main(String[] args) { } } //抽象类 1、防止父类被实例化 2、强制子类去重写父类 //抽象类public abstract class 类名{} abstract class T1 阅读全文
posted @ 2022-05-11 22:53
听雨潇湘
阅读(31)
评论(0)
推荐(0)
摘要:
//方法重载 同一个类中方法名相同,方法的参数不一样 public void test(int x){ int age = 1; System.out.println(age); } public int test(String a, int x) { int age = 1; System.out 阅读全文
posted @ 2022-05-09 23:31
听雨潇湘
阅读(123)
评论(0)
推荐(0)
摘要:
// 普通变量记录一个学生的信息 String name = "jack"; int age = 18; String school = "北京大学"; //数组记录多个学生的信息 String[] names = new String[3]; int[] ages = new int[3]; St 阅读全文
posted @ 2022-05-08 23:26
听雨潇湘
阅读(19)
评论(0)
推荐(0)
浙公网安备 33010602011771号