Home » Author Archives: Sotirios-Efstathios Maneas

Author Archives: Sotirios-Efstathios Maneas

Sotirios-Efstathios Maneas
Sotirios-Efstathios (Stathis) Maneas is a PhD student at the Department of Computer Science at the University of Toronto. His main interests include distributed systems, storage systems, file systems, and operating systems.

Java Volatile keyword example

In this tutorial we will discuss about the volatile keyword in Java. When a field is declared as volatile, then, the Java Memory Model ensures that all threads will “see” the same consistent value. In Java, a global ordering is imposed on the read and write operations concerning a volatile variable. A thread that access a volatile field, will first ...

Read More »

java.util.concurrent.locks.Condition Example

In this tutorial we will discuss about the Condition interface in Java. A Condition object, also known as condition variable, provides a thread with the ability to suspend its execution, until the condition is true. A Condition object is necessarily bound to a Lock and can be obtained using the newCondition() method. Furthermore, a Condition enables the effect of having ...

Read More »

java.io.Externalizable Example

In this tutorial we will discuss about the Externalizable interface in Java. The Externalizable interface provides a way to implement a custom serialization mechanism. A class that implements the Externalizable interface is responsible to save and restore the contents of its own instances. Furthermore, the Externalizable interface extends the Serializable interface and provides two methods to serialize and de-serialize an ...

Read More »

Java StringReader Example

In this tutorial we will discuss about the StringReader in Java. The StringReader class represents those character streams, whose source is a string. The StringReader class extends the Reader class, which is an abstract class for reading data from character streams. The sub-classes of the Reader class must implement the following two methods: read(char[], int, int) close() Finally, the StringReader ...

Read More »

Java AutoCloseable Interface Example

In this tutorial we will discuss about the AutoCloseable interface in Java. This interface represents an object that holds its resources until it is closed. Examples of such resources are a file handler and a socket handler. The close() method of an Object that implements the AutoCloseable interface is called automatically, when exiting a try-with-resources block and that object has ...

Read More »

java.lang.SecurityException – How to solve SecurityException

In this tutorial we will discuss about SecurityException in Java. This exception is thrown by the security manager, in order to indicate a security violation. The SecurityException class extends the RuntimeException class and thus, belongs to those exceptions that can be thrown during the operation of the Java Virtual Machine (JVM). It is an unchecked exception and thus, it does ...

Read More »

java.util.InputMismatchException – How to solve InputMismatchException

In this tutorial we will discuss about the InputMismatchException in Java. This exception is thrown by an instance of the Scanner class to indicate that a retrieved token does not match the pattern for the expected type, or that the retrieved token is out of range. The InputMismatchException class extends the NoSuchElementException class, which is used to indicate that the ...

Read More »

java.lang.NoSuchFieldError – How to solve SuchFieldError

In this tutorial we will discuss about the NoSuchFieldError in Java. This exception is thrown to indicate that an application tries to access or modify an object’s field, but that field no longer exists. This error can only occur during runtime, if the definition of a class has incompatibly changed. The NoSuchFieldError extends the IncompatibleClassChangeError class, which is used to ...

Read More »

java.lang.StringIndexOutOfBoundsException – How to solve StringIndexOutOfBoundsException

In this tutorial we will discuss about the java.lang.StringIndexOutOfBoundsException in Java. This exception is thrown by the methods of the String class, in order to indicate that an index is either negative, or greater than the size of the string itself. Moreover, some methods of the String class thrown this exception, when the specified index is equal to the size ...

Read More »

java.io.tmpdir Example

In this tutorial we will discuss about the java.io.tmpdir system property. The java.io.tmpdir system property indicates the temporary directory used by the Java Virtual Machine (JVM) to create and store temporary files. The default value is typically "/tmp", or "/var/tmp" on Unix-like platforms. On Microsoft Windows systems the java.io.tmpdir property is typically "C:\\WINNT\\TEMP". During your application’s execution, you can acquire ...

Read More »