loops and stuff
-
Foo foo = null;
for(Foo bar: Foobars){
foo = bar;
}if(foo == null){
return someErroR;
}Then also:
int i = 0;
for(String s : stringArray){
if(i > 0){
stringArray[i] = joinCharacter + stringArray[i];
}
i++;
}Elephant elephant elephant, sunshine sunshine sunshine
-
Foo foo = null;
for(Foo bar: Foobars){
foo = bar;
}if(foo == null){
return someErroR;
}Then also:
int i = 0;
for(String s : stringArray){
if(i > 0){
stringArray[i] = joinCharacter + stringArray[i];
}
i++;
}Elephant elephant elephant, sunshine sunshine sunshine
The second one would fall flat on its face in C#. Does it actually work in Java? If it does, that's a huge WTF.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
-
The second one would fall flat on its face in C#. Does it actually work in Java? If it does, that's a huge WTF.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
-
Are you talking about the foreach syntax?
Elephant elephant elephant, sunshine sunshine sunshine
No, the modification of the collection while looping it.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
-
No, the modification of the collection while looping it.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
Brisingr Aerowing wrote:
No, the modification of the collection while looping it.
I've had issues trying to remove elements from a collection while looping but I have not had an issue just changing a value of the collection items, have you?
There are only 10 types of people in the world, those who understand binary and those who don't.
-
The second one would fall flat on its face in C#. Does it actually work in Java? If it does, that's a huge WTF.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
Hate to say it, but that should work just fine, even in a C# foreach. It's just the product of a deranged mind.
"There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli
-
Hate to say it, but that should work just fine, even in a C# foreach. It's just the product of a deranged mind.
"There are three kinds of lies: lies, damned lies and statistics." - Benjamin Disraeli
I've had code like that crash several times. It seemed kinda hit or miss. Never figured out what happened.
What do you get when you cross a joke with a rhetorical question? The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism. Do questions with multiple question marks annoy you???
-
Brisingr Aerowing wrote:
No, the modification of the collection while looping it.
I've had issues trying to remove elements from a collection while looping but I have not had an issue just changing a value of the collection items, have you?
There are only 10 types of people in the world, those who understand binary and those who don't.
I believe Brisingr is thinking of when you iterate through a enumerable and you attempt to update the ienumerable item. Like the following:
for(String s : stringArray){
if(i > 0){
// if you attempt to update the s var.
s = joinCharacter + stringArray[i];
}
i++;
}It's fine to update the other referenced collection (stringArray[i]). Brisingr probably was just thinking about that. Not trying to start a battle by speaking for him though.
My book, Launch Your Android App, is available at Amazon.com.