Add Item Into Array Python Memory Allocation In Java