Explain the I/O Reader class heirarchy?

The Reader hierarchy in Java

A `java.io.Reader` in Java is a class dedicated to reading character streams. By default Java provides many `Reader` implementations and we will look closely at some of them.


One of the most useful readers is the `FileReader` it allows us to read characters from a file. We will showcase the most […]

How does a thread pool differ from thread group?

Thread groups

`java.lang.ThreadGroup` is a class containing one or more threads. Additionally groups can contain other groups.

All threads in Java belong to a thread group – by default threads are assigned to a default (main) thread group.

While a `ThreadGroup` seems like an useful concept, unfortunately it’s implementation is serverly lacking. The methods that are […]

How does system.out.printf differ from system.out.println

When java came around many complained about the lack of a “printf” function. But what exactly is printf and how is it useful.

Let’s start with the vanilla `println` and what does it do. Println comes in a couple of varieties: the no argument one `println()` the one defined on `String` and character arrays, the ones […]

A short history of java?

In this article I’ll present a short history of Java and the jvm. I will be mostly concentrating on the technical issues and features introduced in each release.

Let’s get started then!

JDK 1.0 – January 1996

Initially called Oak, the first stable release of JDK 1.0.2, is called Java 1

J2SE 1.2 – December 1998

This and next releases […]

How to delete multiple items in android ListView

There are times when you require a list of items to let you select multiple items and do operation on the selected items. In this tutorial you will learn how to do this in Android.

The tip here is to have a listview which has set choice mode set to multi choice mode and which also […]

What is the difference between Callable, Runnable and FutureTask?


`java.lang.Runnable` is a simple interface with a single single void method: `run()`. It’s purpose is to have a common interface for code that wishes to be executed (i.e a task for a Thread).

Mostly we see `Runnable`s when we would encounter `Thread`s but the programmer doesn’t wish to override anything but the run method.

As a […]

What is the purpose of BlockingQueue in Java?

In Java a `java.util.concurrent.BlockingQueue` is a concurrent data structure implementing a queue. A queue is a simple data structure that one can put elements into or take out.

The “blocking” semantics come into play when we use the `put(t)` and `take` methods – those methods will block the taking/putting thread if the queue is full (in […]

What is the difference between File and RandomAccessFile objects?

Both `File` and `RandomAccessFile` classes “operate” on files but they have different areas of expertise. We’ll talk about both of those classes.


`java.io.File` deals with the file-system aspects of the file i.e creating it, deleting, querying if it exists, getting paths etc.

To read a File we usually either use a `Reader` (e.g `java.io.FileReader`) or an `InputStream` […]

What is the purpose of bit sets in Java?

There are two ways to view a `java.util.BitSet` in Java: either it is a convenient way to conveniently store a set of integers (or some other data that may be converted to an integer) or `BitSets` may be viewed as a growable vector of booleans (or bits).

Individual bits can be set on and off (elements […]

What is epoch and what is its significance in java?

Epoch also known as the unix epoch is a single date 1 January 1970 at 00:00:00 UTC. It is quite common to measure time from this date something known as epoch time or unix time.

There is some ceremony in handling leap seconds (seconds inserted into a minute so that the astronomical time matches more […]


Enter your email address:

Delivered by FeedBurner

Java ExperienceA place for all type of Java web tutorials2014