class E_up

来源:互联网 发布:淘宝苏宁易购退笔记本 编辑:程序博客网 时间:2024/06/08 13:22
class Monkey{private int n=100;void speak(String s){System.out.println(s);}}class People extends Monkey{void compute(int a,int b){int c=a+b;System.out.println(a+"+"+b+"="+c);}void speak(String s){System.out.println("**"+s+"**");}}class E_up{public static void main(String[] args){Monkey monkey=new People();monkey.speak("fdfdfdfdfdf");People people=(People) monkey;people.compute(10,10);}}

原创粉丝点击