摘要: 异常 package error;​public class Test { public static void main(String[] args) { int a=1,b=0; try { System.out.println(a/b); } catch (Exception e) { Sys 阅读全文
posted @ 2021-10-08 20:54 clown-lan 阅读(8) 评论(0) 推荐(0)
摘要: instanceof 抽象类 package oop.demo8;​//约束,子类帮助实现,不能new这个对象//抽象方法必须在抽象类中,抽象类中可以有普通方法abstract public class Demo8 { abstract public void something();​} 接口 p 阅读全文
posted @ 2021-10-08 19:32 clown-lan 阅读(22) 评论(0) 推荐(0)
摘要: 多态 package oop.demo7;​public class Demo7 { public static void main(String[] args) { //一个对象的实际类型是确定的 new Student()​ Student student=new Student(); //St 阅读全文
posted @ 2021-10-08 17:30 clown-lan 阅读(8) 评论(0) 推荐(0)
摘要: Super 调用父类构造方法,必须第一个 super只能出现在子类构造方法或子类方法中 super和this只能有一个出现在构造方法中 this 本身调用者这个对象 super 代表父类对象的应用 package oop.demo5;​public class Test { public stati 阅读全文
posted @ 2021-10-08 17:29 clown-lan 阅读(24) 评论(0) 推荐(0)