什么是多态
简单的来说就是具有多种形态的能力的特征
package ten; public interface Day1 { public void ring(); } package ten; public class Day2 extends Day3 implements Day4,Day1 { @Override public void openlock() { // TODO Auto-generated method stub System.out.println("..............."); } @Override public void getlock() { // TODO Auto-generated method stub System.out.println("..............."); } @Override public void open() { // TODO Auto-generated method stub System.out.println("..............."); } @Override public void close() { // TODO Auto-generated method stub System.out.println("..............."); } @Override public void ring() { // TODO Auto-generated method stub System.out.println("..........25646+....."); } } package ten; public abstract class Day3 { //开门 public abstract void open (); //关门 public abstract void close(); } package ten; public interface Day4 { //开锁 public void openlock(); //上锁 public void getlock(); } package ten; public class luge { public static void main(String[] args) { // TODO Auto-generated method stub Day2 d = new Day2(); d.getlock(); d.open(); d.openlock(); d.close(); d.ring(); } }