jQuery in Action, 2nd edition
The moose likes Beginning Java and the fly likes List Iterator and If statement Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "List Iterator and If statement" Watch "List Iterator and If statement" New topic
Author

List Iterator and If statement

Hosh Nasi
Ranch Hand

Joined: Sep 10, 2004
Posts: 44
In the code below I am trying to iterate through a list and call a method from the currently referenced object "If" its variable nRefId matches the nRefId of the calling object.



Thanks again guys. I am so close to the end now I can feel it.
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Hosh Nasi,

You're not very clear on what your problem is. I take it that line doesn't compile? The capital "I" in "if" won't help. Failing that it looks fine. If that's not your problem can you be more specific?

Jules
Hosh Nasi
Ranch Hand

Joined: Sep 10, 2004
Posts: 44
Yeah you nailed it.. I have been tirelessly working on this, and I am missing the little things..

Thanks.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Hosh Nasi:
If(myObj.nRefId = nRefId)


Assignment is =. Logical comparison is ==.



"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
 
I agree. Here's the link: jrebel
 
subject: List Iterator and If statement
 
Similar Threads
add element to list while iterating it.
Access to methods in vector objects
EJB-QL Question
ArrayList Headaches.
Method to return next object from a List