KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why does the following work fine? String str; while (condition) { str = calculateStr(); ..... } But this one is said to be dangerous/incorrect: while (condition) { String str = calculateStr(); ..... } Is it necessary to declare variables outside the loop?
Tags (comma-separated)
Save Edits
Cancel