Efficient Counter in Java

You may often need a counter to understand the frequency of something (e.g., words) from a database or text file. A counter can be easily implemented by using a HashMap in Java. This article compares different approaches to implement a counter. Finally, an efficient one will be concluded. UPDATE: Check out Java 8 counter, writing … Read more

Google Guava Splitter Example

Sometimes, Java standard library is not good at string manipulation. Google Guava is a library written by Google which provides some nice features. The following example shows how to use Google Guava Splitter’s Modifier methods. Before starting, you need to download Google Guava jar file first and add it to your project path. Splitter.on(“…”) is … Read more