package JavaPractice; class Monkey { private String s; public Monkey() { } public Monkey(String s) { this.s=s; } public String getS() { return s; } public void speak() { System.out.println("咿咿呀呀......"); } } class People extends Monkey { public void speak() { System.out.println("小样的,不错嘛!会说话了!"); } public void think() { System.out.println("别说话!认真思考!"); } } public class E { public static void main(String[] args) { Monkey m=new Monkey(); People p=new People(); m.speak(); p.speak(); p.think(); } }