b******g 发帖数: 669 | 1 All set cares uniqueness and equals() determine whether two object are
identical.
但是我test 了下
import java.util.HashSet;
public class testT {
private String name;
public testT(String name){
this.name=name;
}
public boolean equals(Object o){
if(!(o instanceof testT))return false;
testT person=(testT)o;
return person.name.equals(this.name);
}
public static void main(String[] args){
HashSet hs=new HashSet();
testT p1= new testT("jing");
... 阅读全帖 |
|
s******r 发帖数: 1524 | 2 data testt;
input id $3. cat val ;
datalines;
aaa 1 123
aaa 2 456
aaa 9 789
bbb 1 235
bbb 9 666
ccc 1 124
ccc 2 675
ccc 3 222
ccc 9 111
;
run;
proc sort data=testt;by id;run;
data testt_new;merge testt testt(where=(cat9=9) rename=(val=val9 cat=cat9));
by id;
drop cat9;
run;
ID |
|
|
N****g 发帖数: 5172 | 4 ☆─────────────────────────────────────☆
DVD209 (dvd209) 于 (Mon Mar 30 17:49:03 2009) 提到:
test |
|
w*****3 发帖数: 16 | 5 来自主题: Immigration版 - testt test |
|
|
|
r***y 发帖数: 4379 | 8 跟 hashcode 没关系, 你的 equals() 方法实现错误
的 equals() 中 -- return person.name.equals(this.name);
比较的就是 string pool 中的静态string "jing"
你两次new testT 都指向同一个 string object
当然 equals() 是 true
另外, 即使你 new String("jing") 两次, 用 string 的equals 还会是 true
因为 String 的 equals 在比较它内涵的 char[]
are |
|
s******r 发帖数: 1524 | 9 not sure what you want.Try
data test1 test2(keep=idx);set test;
idx=_n_;
if **** then output test2;
else output test1;
run;
data test2;set test2;
idx=.;
run;
data testt;set test1 test2(in=in2);
drop idx;
run;
在 hehehehe (入了大圣教,心中充满喜乐) 的大作中提到: 】 |
|
m*********k 发帖数: 10521 | 10 [HongKong] pricess2008 Nov 2 ● 恭祝HK新斑竹板斧上任,发100个包纸同乐*^_
^*
扣除版面:(HongKong)1770伪币成功
成功奖励 10 伪币的用户: xiaoxiaoshij, znprc, Unstoppable, Bbrave, waiwaiwai,
kanbbs, irene2, spidermonkey, hanzo, jh11, lakes, bigbigapple, cooI,
traffic00, tellmenot, LOV, donttell, faner, alliah, ladyred, I7788, mahjong,
Alr, aimer, firingdragon, donthurtme, iveney, images, Grad, JM10,
SteelDragon, wham, weiyixiao, inLove, contact, editor, zbmjk, waiver,
scarlett, testt, stocks, xinlei, evence, YaTou22, miny, QianJua... 阅读全帖 |
|
m*********k 发帖数: 10521 | 11 "[EB23]Qheart Jan 31 ● 发100个包子求祝福(申请代发了,大家且等着收包"
成功奖励 10 伪币的用户: moneybull, cofaky895, fatmingzhou, heilongjiang,
noles, BigGame, PInce, meatoo, UncleLee, octcmyc, gcvv, AngryYouth, faiths,
susannew, ilovewuhan, charleybei, BlueCactus, Zaini, manbeing, cutegirls,
iBull, yoyo0220, remrofia, ROR, oyeyy7, poppy0526, BelmarBreeze, Medevac, o2
, Sydra, starboard, recoco, flaming, alexx, ropfahj71, redgiant, airfly,
dramawatcher, anyaway, ybwind, icuris, chouwacuipin, Miitbbbs, yateng,
Teamster,... 阅读全帖 |
|