摘要: private default protected public 同一类中 yes yes yes yes 同一包中的类 yes yes yes 子类 yes yes 其它包中的类 yes 阅读全文
posted @ 2022-04-30 23:56 clearHeart99 阅读(14) 评论(0) 推荐(0) 编辑
摘要: instanceof关键字 https://www.cnblogs.com/huachuantingyumian/p/16207004.html final关键字 当类使用final关键字修饰时,类不允许被继承。 public final class A{ } 当方法使用final关键字修饰时,方法 阅读全文
posted @ 2022-04-30 22:50 clearHeart99 阅读(19) 评论(0) 推荐(0) 编辑
摘要: instancof instanceof不仅可以判断对象是不是某个类的实例,还可以判断对象继承的基类和实现的接口。 public interface Study { public void study(); } public class Student implements Study{ @Over 阅读全文
posted @ 2022-04-30 00:07 clearHeart99 阅读(179) 评论(0) 推荐(0) 编辑