About final keyword and memory allocation
Hi all,
my question is about final keyword and memory allocation.
Supposing a code like the next one. I ask if the 'msg' object in the dispatch() method allocate memory that is never freed or if it is freed when a new call to dispatch() is done (anser keep allocated only the last allocated msg.
publicfinalclass SocketConn{
privatestaticvolatile DataFrame answer =new DataFrame();
privatevoid dispatch(byte[] data){
final DataFrame msg =new DataFrame(data);
SwingWorker worker =new SwingWorker(){
public Object construct(){
dispatchREQ(msg);
returnnull;
}
};
worker.start();
}
privatevoid dispatchREQ(DataFrame msg){
...
answer = msg;
...
}
}
Thank's in advance for any answer.

