글 수 3,386
import Human.Female.*;
public class GetGirlFriend extends Love {
public GirlFriend GetGirlFriend(){
String TAG = GetGirlFriend.class.toString();
GirlFriend girlFriend = null;
try{
for(int i = 0; i < Human.Female.length; i++){
if((Human.Female[i].State == SomeoneWhoLovedMe) &&
(Human.Female[i] != Mother)){
girlFriend = Human.Female[i];
}
}
} catch (girlFriendException e) {
Log.e(TAG, "I can not find SomeoneWhoLovedMe value." + e.toString());
}
return girlFriend ;
}
}
실행결과 : I can not find SomeoneWhoLovedMe value.





예외처리까지 해주는 치밀함...