Java, Software Development

Java – Where can we place the public static void main method?

Many Java programmers are only familiar with having the public static void main in a class to start the application. However, there are other places where we can define this

Read More...

Java, Software Development

Java – How to skip and not execute the finally clause

They say that when an Exception occurs, the finally clause, if available, will always execute no matter except for one thing.

Read More...

Java, Software Development

Spring Boot – Access Spring ApplicationContext in JUnit Tests

This post shows how to access the Spring ApplicationContext object in JUnit tests. Now, why would we want to do that? Well, sometimes, we need to work directly with the

Read More...

Java, Software Development

Remove XML Element based on parameter in Java using XSLT

This post shows how to remove an XML element based on some parameters in Java using XSLT. We mean parameters for the Transformer object and let XSLT work its magic

Read More...

Java, Software Development

Java – Closing JDBC Database Resources with try-with-resources

This post demonstrates how to use Java JDBC API with try-with-resources database resources in the following order – ResultSet, Statement, and Connection. The try-with-resources is a new exception handling mechanism

Read More...

Java, Java Tutorial, Software Development

Chapter 7: Java Classes And Access Modifiers – Review

Java classes and their variables and methods can use access modifiers – private, public, protected, and package-level (no keyword). These access modifiers set the classes’ visibility, constructors, and instance or

Read More...

Java, Software Development

Java – Block main thread until another Thread completes

Given a simple Java application with a Thread object, we want to block the main thread until the Thread object completes its execution. The main thread is where the Thread object is created and its start method invoked.

Read More...

Java, Software Development

SFTP in Batch Mode Hangs Using Runtime.exec() in Java

When we have applications that call native commands via java.lang.Runtime.exec(), be wary of the invocations. It could potentially output an overwhelmingly large number of texts to the standard output—for example, the

Read More...

Java, Software Development

Invoking JavaScript from within an Applet

If you did not know that you can invoke JavaScript from within an Applet, chances are you would port most JavaScript codes to Java or, worse, resort to some exotic

Read More...

Java, Software Development

Using JPoller

JPoller is a general purpose Java component to poll directories and asynchronously notify client code of incoming files.

Read More...