Java, Software Development

Java – Monitor Directory for File Creation

In batch processing, there are use-cases that require event triggers to start operations on data sources, e.g., files or remote web endpoint. These could be user-initiated events like clicking a button. They could even be system-generated ones like file creation. This post demonstrates how to monitor a local file system directory for new files for processing using only Java.

Read More...

Java, Software Development

Java Null Pointer Exception Processing With Try-Catch

In Java, we can handle exceptional events using the try-catch. But not all exceptions are the same. Java Null Pointer Exception processing requires using try-catch in a way that is

Read More...

Java, Software Development

Array-backed Lists in Java

In Java, there are these array-backed lists that are generated when you convert arrays to lists using Arrays.asList(…). The list and the array objects point to the same data stored in the heap. Changes to the existing contents through either the list or array result to changing the same data.

Read More...

Java, Software Development

Wait Until All Threads Complete Execution in Java

Wait Until All Threads Complete Execution in Java

Read More...

Java, Software Development

Java 8 Stream Reduce

The idea of the reduce operation is the generation of a single result from a collection of values or objects. It is similar to the min and max operations exemplified

Read More...

Java, Software Development

Java 8 – Convert Iterator to Stream

Although not a common scenario, some libraries just return Iterator instead of actual Stream or Collection objects.

Read More...

Java, Software Development

Convert a Stream to List in Java 8

So, you’ve been planning to learn the new stuffs made available in Java 8. One of them is the Stream interface. Given a collection, e.g., List, a Stream can be extract using

Read More...

Java, Software Development

Java Primitive Float And Double – What’s the difference?

Any floating-point literal in Java is by default of a double type.

Read More...

Java, Software Development

Java – Beyond String Pool

The String Pool is a location in the Java Virtual Machine (JVM) that collects all the literal Strings from your codes. Java keeps unique Strings for reuse.

Read More...

Java, Software Development

Java – How to pass argument string with spaces to Java

The way you run your application in Java is by invoking java followed by the class name (without the .class extension).

Read More...