-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWang.java
More file actions
40 lines (35 loc) · 912 Bytes
/
Copy pathWang.java
File metadata and controls
40 lines (35 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package JavaCallBack;
/**
* @author hanshizhe
*这个个小王 问 问题
*/
public class Wang implements CallBack{
private LI li;
/**
* @param li
* 小王的构造方法,持有小李的引用
*/
public Wang(LI li) {
super();
this.li = li;
}
public void askQuestion(final String question){
System.out.println("向小明打电话,请教问题");
new Thread(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
li.executeMessage(Wang.this, question);
}
}).start();
play();
}
public void play(){
System.out.println("我去逛街啦");
}
@Override
public void solve(String result) {
// TODO Auto-generated method stub
System.out.println("结果是"+result);
}
}