KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there any performance penalty for the following code snippet? for (int i=0; i<someValue; i++) { Object o = someList.get(i); o.doSomething; } Or does this code actually make more sense? Object o; for (int i=0; i<someValue; i++) { o = someList.get(i); o.doSomething; } If in byte code these two are totally equivalent then obviously the first method looks better in terms of style, but I want to make sure this is the case.
Tags (comma-separated)
Save Edits
Cancel