这里有段代码! 我看的不大明白,望高手指点一下!不胜感激!
import java.util.*;
interface CanShoot {
void shoot();
}
interface CanMusic {
void mp3();
}
interface CanRadio {
void tune();
}
class Phone {
public void call() {}
}
class MobilePhone extends Phone implements CanShoot, CanMusic, CanRadio {
public void shoot() {}
public void mp3() {}
public void tune() {}
}
public class Superman{
static void t(CanShoot x){
x.shoot();
}
static void u(CanMusic x){
x.mp3();
}
static void v(CanRadio x){
x.tune();
}
static void w(Phone x){
x.call();
}
public static void main(String[] args) {
MobilePhone i = new MobilePhone();
t(i);
u(i);
v(i);
w(i);
}
}
import java.util.*;
interface CanShoot {
void shoot();
}
interface CanMusic {
void mp3();
}
interface CanRadio {
void tune();
}
class Phone {
public void call() {}
}
class MobilePhone extends Phone implements CanShoot, CanMusic, CanRadio {
public void shoot() {}
public void mp3() {}
public void tune() {}
}
public class Superman{
static void t(CanShoot x){
x.shoot();
}
static void u(CanMusic x){
x.mp3();
}
static void v(CanRadio x){
x.tune();
}
static void w(Phone x){
x.call();
}
public static void main(String[] args) {
MobilePhone i = new MobilePhone();
t(i);
u(i);
v(i);
w(i);
}
}
楼主【a748569】截止到2008-07-18 20:40:51的历史汇总数据(不包括此帖):
发帖的总数量:1 发帖的总分数:0 每贴平均分数:0
回帖的总数量:0 得分贴总数量:0 回帖的得分率:0%
结贴的总数量:0 结贴的总分数:0
无满意结贴数:0 无满意结贴分:0
未结的帖子数:1 未结的总分数:0
结贴的百分比:0.00 % 结分的百分比:---------------------
无满意结贴率:---------------------无满意结分率:---------------------
如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html