Talk:Iterator

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
I am just wondering why is there a ">" in the if-statement between name and lastName. Maybe there is a special way of using the "great as" to find out if two Strings are equal in Java but as far as I know it would make more sense to have:
+
I am just wondering why is there a ">" in the if-statement between name and lastName.  
 +
if(name > lastName)
 +
      myIterator.remove();
 +
  }
 +
Maybe there is a special way of using the "great as" to find out if two Strings are equal in Java that I am not aware of but it would make more sense to me to do it like that:
 
   
 
   
  if(name.equals(LastName)
+
  if(name.equals(lastName)
 
  {
 
  {
 
   myIterator.remove();
 
   myIterator.remove();
 
  }
 
  }

Revision as of 23:33, 6 October 2008

I am just wondering why is there a ">" in the if-statement between name and lastName.

if(name > lastName)
     myIterator.remove();
 }

Maybe there is a special way of using the "great as" to find out if two Strings are equal in Java that I am not aware of but it would make more sense to me to do it like that:

if(name.equals(lastName)
{
 myIterator.remove();
}
Personal tools