摘要: package com.tu.oop.demo8;//abstract 抽象类:类 extends:单继承~ (接口可以多继承)public abstract class Action { //约束~有人帮我们实现~ //abstract,抽象方法,只有方法名字,没有方法的实现! public ab 阅读全文
posted @ 2021-11-21 17:14 tuyin 阅读(50) 评论(0) 推荐(0)
摘要: package com.tu.oop.demo7;//staticpublic class Student { private static int age;//静态的变量 private double score;//非静态的变量 public void run(){ } public stati 阅读全文
posted @ 2021-11-21 16:39 tuyin 阅读(42) 评论(0) 推荐(0)
摘要: package com.tu.oop.demo6;public class Person { public void run(){ System.out.println("Person类执行了!!!"); }}/* //一个对象的实际类型是确定的 //new Student(); //new Per 阅读全文
posted @ 2021-11-21 16:36 tuyin 阅读(55) 评论(0) 推荐(0)
摘要: super注意点: 1、super调用父类的构造方法,必须在构造方法的第一行! 2、super必须只能出现在子类的方法或者构造方法中! 3、super和this不能同时调用构造方法!VS this: 代表的对象不同: this:本身调用者的这个对象 super:代表父类对象的引用 前提 this:没 阅读全文
posted @ 2021-11-21 16:32 tuyin 阅读(48) 评论(0) 推荐(0)