The first ( new type[0] ) will actually create an array object (and therefore take up memory). You can use an array object (size 0), for example, to get its length or iterate over it, but you, of course, cannot access any of its elements. That way, you can pass it to any function that makes no assumptions about the length of the array (but the correct checks are performed instead), and it will work.
The second ( null ) does not create any object. You will get an exception if you try to access any member.
source share