Passing NULL Objects
- From: fb <fb@xxxxxxxxx>
- Date: Fri, 04 Nov 2005 03:21:00 GMT
Hello everyone. I have the following:
//Perform a search for the account number
public BankAccount searchAccounts (Vector<BankAccount> bankAccounts , long accountNumber){
int accNum=0;
for(int x=0;x<bankAccounts.size();x++){
if(bankAccounts.elementAt(x) == accountNumber){
return ?? //I want to return the object that matches from the Vector to the calling function
else
return ?? //How do I return a NULL object (The reason is that I can test for it in the returning function)
}
So...returning null objects. Any thoughts? :-) .
- Follow-Ups:
- Re: Passing NULL Objects
- From: Rhino
- Re: Passing NULL Objects
- From: shawnews
- Re: Passing NULL Objects
- From: Michael Dunn
- Re: Passing NULL Objects
- Prev by Date: Re: developing for j2me
- Next by Date: Re: Passing NULL Objects
- Previous by thread: assistance sought for JVM core dump debugging
- Next by thread: Re: Passing NULL Objects
- Index(es):
Relevant Pages
|