Sorry for such simple questions but I am new in Java (usualy write in c)
do new in loop delete old instance of an object?
I need something like
for(;;)
{
// work on here pixels[]
source = new MemoryImageSource(200, 200, pixels, 0, 50);
image = createImage(source;
// then use image here
}
I just need to get here above, new wraping of source
and image
objects
in every frame, and do not want to bother of deleting it,
But also I do not want to store large amounts of them as a memory leak,
Will it be deleted automatically? Is it heavy operation?