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

Rule:  Optimization8Checked automatically with code checker

Synopsis:System.arrayCopy is more efficient
Language:Java
Severity Level:3
Category:Optimization


Description:
Instead of copying data between two arrays, use System.arrayCopy method.
public class Test {
  public void bar() {
    int[] a = new int[10];
    int[] b = new int[10];
    
    // this will trigger the rule
    for (int i=0;i<10;i++) {
      b[i]=a[i];
    }
  }
}