多态
package com.swift.jiekou; public class Jicheng_Tuotai_jingtai_diaoyong { public static void main(String[] args) { Fu f=new Zi(); f.show(); } } class Fu{ static int x=1; public static void show() { System.out.println("父类的方法"+x); } } class Zi extends Fu{ static int x=2; public static void show() { System.out.println("子类的方法"+x); } }