Home » Archives for Aldo Ziflaj

Author Archives: Aldo Ziflaj

Aldo Ziflaj
Aldo is a student of Computer Engineering and a programming addict. He spares his free time coding, whether mobile, web, or desktop programming. He is also one of the co-founders of Things Lab.

Recursion Java Example

In this post, we will see multiple Recursion Examples in Java using recursive methods. Recursion is a method of solving a problem, where the solution is based on “smaller” solutions of the same problem. In most programming languages (including Java) this is achieved by a function that calls itself in its definition. As a recursive joke says, “In order to ...

Read More »

Java MessageFormat Example

In this example we will discuss about MessageFormat class and how to use it to write messages. MessageFormat takes a set of objects, formats them, then inserts the formatted strings into the pattern at the appropriate places. MessageFormat extends the Format class, which is an abstract base class for formatting locale-sensitive information such as dates, messages, and numbers. It defines ...

Read More »

java.util.MissingResourceException – How to resolve Missing Resource Exception

In this example we will discuss about MissingResourceException. This exception is a runtime exception, and it’s thrown when a resource is missing. MissingResourceException extends RuntimeException which is the base class of all exceptions that can be thrown during the normal operation of Java Virtual Machine. By extending RuntimeException, we don’t have to catch MissingResourceException in the code, neither to declare ...

Read More »

Java ByteArrayOutputStream Example

In this example we will discuss about ByteArrayOutputStream class and its usage. This class implements an output stream in which the data is written into a byte array. The buffer automatically grows as data is written to it. The data can be retrieved using toByteArray() and toString(). ByteArrayOutputStream extends OutputStream, the abstract class which is the superclass of all classes ...

Read More »

Java ByteArrayInputStream Example

In this example we will discuss about ByteArrayInputStream class and its usage. A ByteArrayInputStream contains an internal buffer that contains bytes that may be read from the stream. An internal counter keeps track of the next byte to be supplied by the read method. ByteArrayInputStream extends InputStream, the abstract class which is the superclass of all classes representing an input ...

Read More »

Java BufferedInputStream Example

In this example we will discuss about BufferedInputStream class and its usage. The BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the input and to support the mark and reset methods. BufferedInputStream extends FilterInputStream, which simply overrides all methods of InputStream with versions that pass all requests to the contained input stream. The BufferedInputStream class exists since ...

Read More »

Java BufferedOutputStream Example

In this example we will discuss about BufferedOutputStream class and its usage. The class implements a buffered output stream. By setting up such an output stream, an application can write bytes to the underlying output stream without necessarily causing a call to the underlying system for each byte written. BufferedOutputStream extends FilterOutputStream, which is the superclass of all classes that ...

Read More »

Java BufferedWriter Example

In this example, we will discuss the BufferedWriter class in Java and its usage. BufferedWriter writes text to a character-output stream, buffering characters so as to provide for the efficient writing of single characters, arrays, and strings. BufferedWriter extends Writer, which is an abstract class for writing to character streams. The only methods that a subclass must implement arewrite(char[], int, ...

Read More »

Java FileWriter Example

In this example, we will discuss the Java FileWriter class and how to use it to write streams of characters. Whether or not a file is available or maybe created depends upon the underlying platform. Some platforms, in particular, allow a file to be opened for writing by only one FileWriter (or other file-writing object) at a time. In such ...

Read More »

Java equals method – .equals Java Example

In this example, we will discuss the Java .equals method. This is one of the methods that all objects have since it is defined in the Object class, which is the base for all Java classes. The functionality of the .equals method is to check if the object invoking this method is equal to another object passed as an argument. ...

Read More »