摘要: 抽象类 public abstract class Action { public abstract void test01(); } public class Wecome extends Action { @Override public void test01() { } } 注意事项: 1. 阅读全文
posted @ 2022-10-21 00:59 Always_0708 阅读(31) 评论(0) 推荐(0)
摘要: static 代码块 package com.beijing.xiaowen.oop; public class TestStatic { //初始数据源 { System.out.println("匿名代码快"); } //在加载类得时候,只执行一次 static { System.out.pri 阅读全文
posted @ 2022-10-21 00:50 Always_0708 阅读(23) 评论(0) 推荐(0)
摘要: 继承 重写 多态 super super注意点: 1. super调用父类的构造方法,必须在构造方法的第一个 2. super 必须只能出现在子类的构造方法或方法中 3. super和this 不能同时调用构造方法 VS this: 代表的对象不同: this: 本身调用者这个对象 super: 代 阅读全文
posted @ 2022-10-21 00:02 Always_0708 阅读(23) 评论(0) 推荐(0)