Suppose we want to do a task after fixed time interval such as creating a beep sound after 5 seconds or checking the connection status after every 5 seconds. This may be easily accomplished using Executor framework in java. There is a class called ScheduledThreadPoolExecutor which has the methods to perform such kind of scheduling. Let’s get down to code right away:Read More →

Loading a class more than once using java’s built in ClassLoader is not possible because: Builtin ClassLoader always checks if a class has already been loaded. If it is, it simply does nothing and returns. Hence to reload a class, you have to use your custom ClassLoader. Code to reload a class using custom ClassLoader is as follows:Read More →