Wednesday, September 16, 2015

Effective Java Notes

General Programming


Item 45: Minimize the scope of local variables

- declare the local variable where it is used first
- nearly every local variable declaration should contain an initializer
- always prefer for loops to while loops assuming contents of loop variable are not needed after loop