Wednesday, September 26, 2007

Java Performance Tuning

Use Collections for primitive ---
Avoid using generic classes that handle Object types when you are dealing with basic data

types. For example, there is no need to use Vector to store ints by wrapping them in

Integers. Instead, implement an IntVector class that holds the ints directly.



default values that Java initializes variables to----

null for objects

0 for integer types of all lengths (byte, char, short, int, long)

0.0 for float types (float and double)

false for booleans

No comments: