|
Is there a difference in JVM overhead/expense the
following code? and why?
public void someMethod(List
passedList) {
Iterator iter =
passedList.iterator();
while
(iter.hasNext()) {
MyObject myObject = (MyObject)iter.next();
// do some processing on myObject
}
}
compared to:
public void someMethod(List
passedList) {
Iterator iter =
passedList.iterator();
MyObject myObject
= null;
while
(iter.hasNext()) {
myObject =
(MyObject)iter.next();
// do some processing on myObject
}
}
Thanks in advance. |
- [jdjlist] Re: JVM Overhead Stacy C. May
- [jdjlist] Re: JVM Overhead David Gallardo
- [jdjlist] Re: JVM Overhead Barzilai Spinak
