package cn.yyhl.day17;
public class Abstract {
public static void main(String[] args) {
// Animal animal = new Animal();//错误写法,抽象类不能直接创建抽象对象
Cat cat = new Cat()...
"abstract" derives from the Latin word "abstrahere" that means "abs: away" and "trahere: pull'". 词根里含"trahere"的词还有: attract(磁铁把铁拉过去. Magnets attract iron.), detract(贬低, 把好评拉走), d...
一、抽象方法
public abstract void eat();
二、抽象类
package cn.wt.day08.Demon12;
public abstract class Animal {
public abstract void eat();
}
注意·:含有抽象方法的类,一定是抽象类;抽象类不...
java抽象类
java abstract class
有时候,我们需要用到抽象类。比如我们想买水果,但是不确定买的是苹果还是香蕉
Sometimes, we want to abstract a class.For example, We want buy some fruits,but we are n...