The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
The strength of the Wolf is the pack & the strength of the pack is the wolf....Rudyard Kipling
Originally posted by Vin Kris:
In snippet #1 v.size() is evaluated for every iteration of the loop. In your example, the loop body is not modifying the contents of the vector, but other loops may - so every iteration will compare at a different value. The compiler cannot make the assumption with the Vector that the contents will not change.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Originally posted by Thomas Paul:
1718 - v.size()
32 - size
So I decided to change it to using an ArrayList instead of a Vector:
47 - v.size()
16 - size
So what have we learned today? Don't use the Vector class!
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Vin Kris:
Step 18 - invokevirtual. This means Vector.size() is not getting inlined, isn't it?. I tested this in 1.4.1-beta.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus