Looping... 2006-11-07 - By Ne'Bahn
Back Hi list:
What are the consecuences of breaking a loop in this manner:
// items - the number of items on the array // values - the array itself
public boolean find(double searchKey) { for (int i = 0; i < items; i++) if (values[i] == searchKey) return true; return false; }
AFAIK when an instance leave a method all variables "dissapear" (stack flushes, take some air, if they are objects the garbage collector prepares for..). The fact is that I don't like to use the "break" keyword so I want to know if this way is the same that "break, then return".
Thanks in advance.
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|