Afou To Patisa Posted July 29, 2017 Share Posted July 29, 2017 Ok i have a question that bother me 5 seconds now Let's say we make a class and this class just do something public class Spammer { final L2PcInstance _player; int index = 0; Spammer(L2PcInstance player) { _player = player; start(); } public void start() { ThreadPoolManager.scheduleFixedRate(new Runnable() { @Override public void Run() { if (index == 5) { _player.sendMessage("hi"); index++; } else _threadpool.cancel(true); } }, 1000, 1000); } } The code is really to explain you. So let's say we do new Spammer(player); this will start the threadpool and after 6 times it will stop send player a message. But what java do afterwards? What happen to this class created as new object ? It get fucked up garbage collector since its not doing anything ? I did a code that basically create a new object for vote but i was wondering after the time expire and give reward or no give reward what happen to this class? Thanks Quote Link to comment Share on other sites More sharing options...
Solomun Posted July 29, 2017 Share Posted July 29, 2017 If i got your question right, take a look at this, it might help you and cover your question. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.