day10--对象的向上向下转型代码实现
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package com.inmind.object_cast09;
|
||||
|
||||
public class Cat extends Animal{
|
||||
|
||||
public void catchMouse(){
|
||||
System.out.println("猫在抓老鼠");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user