This tutorial shows how to split a string in Java. Below, we present three options to split a string in Java namely – with StringTokenizer class, with split() method of the String class and with Pattern class. Each of the options has its utility and advantage over the other. You can use either of them as per your need.
This article presents an implementation of a tracking thread pool in Java. A tracking thread pool is a usual thread pool that records the task execution statistics like total number of tasks executed, average execution time of tasks and total execution time of all tasks. The default thread pools created by Executors class in Java does not […]
This article shows how to create a deadlock in Java. A deadlock occurs when two threads each hold a lock that the other thread is waiting for. Neither of them can proceed without acquiring the lock held by the other thereby creating a deadlock. To study and analyse a deadlock you should be able to […]
This article shows how to send an email through Gmail in Java. We use the JavaMail API to send email. You can download the JavaMail API jar from here and the reference implementation jar from here. Or if you are using maven then just add the following dependencies in your pom.xml file.