Java????????????
???????????? ???????[ 2013/1/24 11:29:20 ] ????????
??????y??????
??????????????μ????????????????????μ????????????????????????????????????????????y??????????????????????????????????????????????????????????????????y???
??????????????????????з??????????????
public Object findLargest(Object object1?? Object object2) {
Relatable obj1 = (Relatable)object1;
Relatable obj2 = (Relatable)object2;
if ((obj1).isLargerThan(obj2) > 0)
return object1;
else
return object2;
}
?????????????????object1?????Relatable??????obj1???????isLargerThan??????
?????????????????Relatable??????????????????????
public Object findSmallest(Object object1?? Object object2) {
Relatable obj1 = (Relatable)object1;
Relatable obj2 = (Relatable)object2;
if ((obj1).isLargerThan(obj2) < 0)
return object1;
else
return object2;
}
public boolean isEqual(Object object1?? Object object2) {
Relatable obj1 = (Relatable)object1;
Relatable obj2 = (Relatable)object2;
if ( (obj1).isLargerThan(obj2) == 0)
return true;
else
return false;
}
??????Щ???????????κ?“Relatable”???????????????й?????????Relatable?????????????????????????????????????Relatable???????????????????????е????????????????????????????????
??????д???
???????????????????????DoIt??
public interface DoIt {
void doSomething(int i?? double x);
int doSomethingElse(String s);
}
??????????????????μ???????????????????????
public interface DoIt {
void doSomething(int i?? double x);
int doSomethingElse(String s);
boolean didItWork(int i?? double x?? String s);
}
?????????????????????????????DoIt???????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????д??????????磬?????д???DoItPlus????????е????
public interface DoItPlus extends DoIt {
boolean didItWork(int i?? double x?? String s);
}
??????????????????????????t???DoIt????????????????DoItPlus??
???????
?????????????????????Э?顣
????????????????????Щ???????????signatures????????????????????????????Щ??????
????????????????????y?????????????е??????
???????κ???????????????????????y????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11