how expensive is \'new\'? I mean, should I aim at reusing the same object or if the object is \'out of scope\' it\'s the same as emptying it?
example, say a method crea
its an array list, so creating a new object means allocating a slab of memory and zeroing it, plus any bookkeeping overhead. Clearing the list means zeroing the memory. This view would lead you to believe that clearing an existing object is faster. But, it's likely that the JVM is optimized to make memory allocations fast, so probably none of this matters. So just write clear, readable code, and don't worry about it. This is java after all, not c.