I am undertaking the task of learning Java for a class and have a quick question for any of you more knowledgeable than I....
Below is my code:
p = new Packet(0, 1, mc);
p = new Packet(0, 2, mc);
My question is, will this cause a memory leak when p is reassigned. I believe in C++ there is a delete reserved word that called the destructor for the class. (Packet is a class) This does not seem be be available in Java. If the above will cause problems, what is the correct way to do the above.
Thank you for any information you may have,