Home » Author Archives: Ilias Koutsakis

Author Archives: Ilias Koutsakis

Ilias Koutsakis

Ilias has graduated from the Department of Informatics and Telecommunications of the National and Kapodistrian University of Athens. He is interested in all aspects of software engineering, particularly data mining, and loves the challenge of working with new technologies. He is pursuing the dream of clean and readable code on a daily basis.

Java Synchronized keyword Example

In this example we shall show you how to use the synchronized keyword in Java. Java allows us to use concurrency and multithreading pretty easily. Some of the most common use cases are those in which we have an object and many threads interacting with it. This can create many problems, because in cases that 2 different threads try to ...

Read More »

org.apache.commons.io.FileUtils Example

In this example we are going to show some of the capabilities of the FileUtils class, which is a part of Apache Commons IO. The methods implemented in this class are all about file manipulation, and in many cases they make a developer’s life much easier. The main reason that this and other classes in Apache Commons exist, is that ...

Read More »

Java Annotations Example

Annotations are special instructions included in the source code of a Java program. They were introduced in Java 5, and their main point was to reduce the XML usage for metadata, which tends to become complicated and cumbersome. Another great thing about annotations is the fact that they can be processed both in compile-time/runtime (by a framework or the language ...

Read More »

java.util.concurrent.LinkedBlockingQueue Example

In this example we are going to explain the use of the LinkedBlockingQueue class, and how it is different from the similar ArrayBlockingQueue. The main point of similarity is the concurrent capabilities of both classes, which makes sense as both are part of the java.util.concurrent package. Although they are the most common implementations of the BlockingQueue interface, certain differences need to ...

Read More »

java.util.concurrent.ArrayBlockingQueue Example

In this post we are going to present the ArrayBlockingQueue class, which implements the BlockingQueue interface. The main reason to use the ArrayBlockingQueue class is that it is thread-safe, in the sense that it can be used concurrently between different threads without any risk. Moreover, it has a specific capacity limit, which can be used in our advantage, e.g. when we ...

Read More »

java.net.MulticastSocket Example

In this example we are going to explain how to use MulticastSocket in Java, in order to enable a server to easily send information to multiple clients, which are all connected to the same port and address. We will describe the whole process, by creating both the server and the client, and guide you through the main concepts that need to be understood to ...

Read More »

java.util.Deque example

In this example, we are going to explain the java.util.Deque interface. The interface name is an abbreviation of “Double Ended Queue”, and it is essentially a queue that implements methods which allow the developer to add elements to both ends of the queue (head and tail). We are goig to show the most important methods of this interface, as well ...

Read More »

java.net.NetworkInterface Example

In this example we are going to examine the java.net.NetworkInterface class. This class allows us to programmatically gather information about our network interfaces, and it is especially useful in cases where we need to do some programming using networks and connections. We will explain some of the most important methods and usage of this class and show the retrieved information.   ...

Read More »

Transient variables in Java

In this post we are going to examine what a transient variable is in Java and learn how to use them in the right context. In order to do that we are going to also take a quick look into the Serializable interface and its usefulness.         1. Object Serialization and “transient” variables Serialization is a process where ...

Read More »

Exceptions Hierarchy and Custom Exceptions in Java

Exceptions are a vital part of every modern programming language, as it is a way to handle error cases and unexpected behavior, without necessarily terminating the whole application. Except for that, by handling the exceptions in the correct way, we can get meaningful feedback regarding what went wrong, why and where. As you can understand, it is very important for every ...

Read More »