KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How is Java's for loop code generated by the compiler? For example, if I have: for(String s : getStringArray() ) { //do something with s } where getStringArray() is a function that returns the Array I want to loop on, would function be called always or only once? How optimal is the code for looping using this construct in general?
Tags (comma-separated)
Save Edits
Cancel