When you have a list of similar tasks to perform, creating a Java Thread Pool is a good option. Start off my creating a Runnable that takes care of the needed task. Create a thread pool with the number
The Java System class comes with some very useful methods when it comes to System Properties. The Java platform uses a Properties object to maintain its own configuration. The Properties object describes the configuration of the current working environment.
Many Java applications will query the running environment for variables that are needed for the Java process. This can be done on a windows system or on something like Linux if that is your working platform. For our purposes,
The Java String class has three replace methods to manipulate a string. We have replace(), replaceAll(), and replaceFirst() methods to accomplish the replace of characters or strings within a string. The String.replace(arg1, arg2) method will return a new string
Most Java applications require a standard logging mechanism. Log4j is a Java based logging utility that is widely used among Java programmers. This tutorial explains how to configure the log4j xml and how to log to different log files
The Apache Log4J logging utility is a must have for most Java programmers that need robust logging for Java application logging. Let’s go through a step by step tutorial from start to finish. There are a list of assumptions
The Java String class has a lot of methods to manipulate Strings. The substring() method is a good option to be able to sub divide a string into a new string. The sample code below shows a few different
Java has a couple of options to generate random numbers. The first option is to combine the random() method with the floor() method of the Java Math class. The floor() method allows you to set the upper bounds of
The Java ArrayList collection class is a good option when you need to store a collection of data. The collections class can store just about anything, but it’s best to stay consistent. If you declare an ArrayList to hold
As a Java developer, I like to know when something changes with the configuration file, for example, that my Java application read at startup. Now what happens if you modify a parameter in the config file after startup? Nothing