Arrays

Hi,Does anyone know how many bytes does java allocate when I declare a character or a string array like this:char[] a = new char[] without specifying the size.Is it a good idea to not to specify the size?Please help
[257 byte] By [gopisuri] at [2007-9-26 1:43:49]
# 1
I don't think you can do this and compile safely. The compiler will give you an error like : Array dimension missing.You have to provide the size of the array when initializing an array.
msohaib at 2007-6-29 2:38:24 > top of Java-index,Archived Forums,Java Programming...
# 2

It's somewhat pointless to create an array that can't hold anything but it is doable... here's the trick:

char[] ary = new char[] {} ;

DragonMan at 2007-6-29 2:38:24 > top of Java-index,Archived Forums,Java Programming...