Guest User

Untitled

a guest
Apr 16th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment