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

Rule:  Basic102Checked automatically with code checker

Synopsis:Avoid implicit allocation of objects
Language:Java
Severity Level:4
Category:Basic


Description:

When writing code such as

byte[] myLocalStackVariable = { 0x00, 0x00 };

Java implicitly allocates an object. For some applications this is a bad thing. It is better to make the allocation explicit:

byte[] myLocalStackVariable = new byte[] {0x00, 0x00};

This way everybody will realize that a new object is allocated.