public class Second extends First{ public Second() { getMethod(); } public void getMethod() { System.out.println("second"); } public static void main(String[] args) { new Second(); } } class First{ public First() { getMethod(); } public void getMethod() { System.out.println("first"); } }
输出下面程序的运行结果
最新推荐文章于 2023-03-28 23:44:48 发布