package one; //这是父类代码 public class Che { public String ji; public void zhuangbi(){ System.out.println("苹果手机可以在车上装逼"); } } package one; //这是子类代码 public class Gongjiaoche extends Che { public void zhuangbi(){ System.out.println("苹果手机可以在公交车上装逼"); } } package one; //这是测试代码 public class Cs { public static void main(String [] args){ GongjiaoChe che=new GongjiaoChe(); che.ji="挤"; che.zhuangbi(); System.out.println("特点:"+che.ji); } }