打赏
摘要: 举个例子,有一个对象Car,其有一个方法run(),现在我们需要知道车子跑了多久,OK,我们首先可能会想到使用继承来监听此方法,就知道车子跑了多久了。1 package com.learn.www;2 3 public interface Runable {4 void run();5 } 1 package com.learn.www; 2 3 import java.util.Random; 4 5 public class Car implements Runable { 6 7 @Override 8 public void run() { 9 ... 阅读全文
posted @ 2013-05-28 21:15 lingjiango 阅读(861) 评论(1) 推荐(0)