Blog Archives

Read Excel XLS Files in Java

This tutorial shows how to read Excel .xls files using Java and Apache POI. The Apache POI Project (http://poi.apache.org/) provides Java APIs for manipulating file formats based upon the Office Open XML standards (OOXML) and Microsoft’s OLE 2 Compound Document

Tagged with: ,
Posted in Java

Split a String in Java

Java String class has the method split() to split a string around matches of a given regular expression. java.lang.String: public String[] split(String regex) Parameters: regex – the delimiting regular expression Returns: the array of strings computed by splitting this string

Tagged with:
Posted in Java

Shuffle an Array or a List in Java

How can we rearrange an array of items in random order? A simple way is to manipulate the array by picking elements randomly. Or we can use Java Collections API. Shuffle an Array Write a loop to go through each

Tagged with: , ,
Posted in Java

Interfaces in Java

An interface in Java represents an abstract type; it is a collection of abstract methods and constants. All methods in an interface are abstract, and thus they have only signatures. All variables in an interface are implicitly final and static,

Tagged with: , , , ,
Posted in Java