其他分享
首页 > 其他分享> > 类型转换

类型转换

作者:互联网

package src.com.qiQi.oop;


import src.com.qiQi.oop.Demo08.Person;
import src.com.qiQi.oop.Demo08.Student;

//测试类
public class Application {
public static void main(String[] args) {
Person student = new Student();
((Student)student).guAi();
}
}

/*
子类
public void guAi(){
System.out.println("怪!");
}

父类
public void run(){
System.out.println("run");
}
*/

标签:类型转换,src,void,qiQi,oop,Student,public
来源: https://www.cnblogs.com/shuqiqi/p/16482702.html