daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Animal1 {
  2.     //重写是对父类允许访问的方法的实现过程进行重新编写,返回值和形参都不能改变。
  3.     //即外壳不变,核心重写
  4.     public void move(){
  5.         System.out.println("动物可以移动");
  6.     }
  7. }
  8. class Dog extends Animal1{
  9.     public void move(){
  10.         System.out.println("狗可以跑和走");
  11.     }
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top