This post shows how to run Java codes before an application shutdown. We can use this idea to clean up resources, notify remote systems or display a farewell message before the application completes its execution or terminates. Java Runtime Class
Spring – Multiple Names Or Aliases For A Bean
Sometimes we have use cases that require different codes to reference the same bean using other names or aliases. Fortunately, we can have one bean and give them multiple aliases in Spring. This post shows how to assign multiple names
Java – Convert LocalDateTime to OffsetDateTime in any timezone
This post shows how to convert a Java LocalDateTime object to an OffsetDateTime object at the current zone offset. For example, let’s say we are in Singapore and want to convert the current LocalDateTime to a string value. This string
ExecutorService, AutoCloseable, and Try-With-Resources In Java
This post demonstrates how to use Java ExecutorService and AutoCloseable with try-with-resources. With ExecutorService, we need to call the shutdown method all the time. However, call the shutdown method means we are writing more codes than we should. There has
How To Validate XML String against XSD Without Writing To A File
This post shows how to validate XML string data against XSD files in Java. Most of the time, we work directly with XML files instead of string format. We point to an XML file and validate it against XSDs. However,
Java 8 Convert Stream Values to Map Entries Examples
This post demonstrates how to convert a stream of objects to a Map object using Collectors.toMap(…) methods.
Spring MVC – How To Test For View Name
This post briefly demonstrates how to test for a view name in Spring MVC.
Chapter 1: Introduction to Java as Language and Platform
When we say “Java,” we refer to the Oracle technology with two aspects – Java as a programming language and Java as a platform. Java as a programming language allows us to create Java programs, while Java as an environment
Chapter 4: Oracle JDK8 on Windows 10: Installation
This post demonstrates how to install Oracle JDK8 on Windows 10. Download JDK8 From Oracle First, go to www.google.com and search for “Java JDK 8”. Then, click the link that says “Java SE Development Kit 8 – Downloads“. Once you’re
Chapter 5: Java Classes – The Blueprints And Building Blocks
In How To Write Your First Java Program, we installed an IDE and wrote a basic Java program. We also learned about the essential components of that program’s Java source codes – the keyword class and the main method. Here