TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Rule:  Optimization3Checked automatically with code checker

This rule is Obsolete
Synopsis:Avoid instantiating new objects inside loops
Language:Java
Severity Level:4
Category:Optimization


Description:
Detects when a new object is created inside a loop
public class Something {
  public static void main( String as[] ) {  
    for (int i = 0; i < 10; i++) {
      Foo f = new Foo(); //Avoid this whenever you can it's really expensive
    }
  }
}