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.
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
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.
Wait Until All Threads Complete Execution in Java
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
Although not a common scenario, some libraries just return Iterator instead of actual Stream or Collection objects.
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
Any floating-point literal in Java is by default of a double type.
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.
The way you run your application in Java is by invoking java followed by the class name (without the .class extension).