Discover how to find the last day of a month in Java using both core Java methods and popular libraries. This article provides step-by-step explanations for accomplishing the task using Date and Calendar classes, Java 8’s Date Time API, and the Joda Time library with code examples and test cases.
Search Results for: Java Classes
Adding One Month to Current Date in Java
In this short tutorial, we discuss various methods of adding one month to the current date in Java. We cover using core Java methods as well as popular external libraries such as Joda-Time and Apache Commons Lang3.
The Vector API in Java 19
Explore the Vector API, its associated terminologies, and how to leverage it.
Difference Between Boolean.TRUE and true in Java
Explore the differences between Boolean.TRUE and true in Java to properly use these representations of true boolean values.
Convert Java Array to Iterable
Explore several approaches to convert a Java array to an Iterable collection.
Asserting Equality on Two Classes Without an equals() Method
Learn a few ways of testing for the equality of two objects without the equals() method.
Sort Date Strings in Java
Explore different approaches to effectively sorting date strings in Java.
Mock a URL Connection in Java
Explore several ways of mocking a URL connection to write stand-alone unit tests that don’t rely on external services.
Converting Object To Map in Java
Explore various approaches such as reflection, Jackson, and Gson to convert Java Objects into Java Maps.
Replacing Variables in a Document Template with Java
Learn how to replace a pattern in various locations of a Word document.
Java Weekly, Issue 491
Simplified main entries, CDC for cache, cloud-native Graal, key encapsulation, and event sourcing and audit logs!
Generating Javadoc With Gradle
Learn how to generate Javadoc using the Gradle build system.
Classpath vs. Modulepath in Java
Explore the distinction between the modulepath and classpath in Java.
Creating Custom Iterator in Java
Learn how to create a custom iterator in Java and apply it to our collections.
Java PrintStream to String
This article provides several ways of converting a PrintStream to a String in Java.The approaches include using ByteArrayOutputStream, a custom output stream, and Apache Commons IO.
Java Weekly, Issue 489
Unnamed methods in Java, Hibernate 6 migration, async-profiler, generative AI and jobs, and monoliths are not dinosaurs!
Difference Between FileReader and BufferedReader in Java
Learn how to use FileReader and BufferedReader and the differences between them.
Remove Punctuation From a String in Java
Learn how to remove punctuation from a string using the standard String.replaceAll() method.
Create and Detect Memory Leaks in Java
Learn about memory allocation and garbage collection in Java to prevent memory leaks and build more efficient, robust applications.
Analyze, Generate and Transform Code Using Spoon in Java
Learn how to use the Spoon library to analyze and modify Java source code.