Learn about FileWriter’s common usage and delve into the differences between its flush() and close() methods.
Search Results for: close
Apache HttpClient vs. CloseableHttpClient
Look at the difference between Apache HttpClient API’s HttpClient and CloseableHttpClient
Open/Closed Principle in Java
Explore the Open/Closed Principle (OCP) as one of the SOLID principles of object-oriented programming in Java.
Should We Close a Java Stream?
Ever wondered if it’s important to close a Java 8 Stream?
“Stream has already been operated upon or closed” Exception in Java
Discover how to solve the “Stream has already been operated upon or closed” exception in Java.
Convert InputStream to Stream in Java
Learn how to take an InputStream and convert it into a functional Stream in Java.
Introduction to SSHJ
Learn the basic usage of the SSHJ library for secure communication with remote servers.
Converting short to byte[] in Java
Learn how to convert a short value to a byte[] array.
BigDecimal equals() vs. compareTo()
Explore the differences between BigDecimal equals() and compareTo() methods.
How to Fix EOFException in Java
In this quick tutorial, we learn how to fix the java.io.EOFException, a special type of IOException.
PersistenceUnit vs. PersistenceContext
Learn the main differences between PersistenceUnit vs. PersistenceContext in the JPA context.
Compress and Create a Byte Array Using GZip
Learn how to get the compressed data in a byte array when using the GZIP file format.
Introduction to Simple Java Mail
Explore the process of setting up Simple Java Mail and learn how to send emails, including attachments and HTML content, handle exceptions, and more.
Finding the Redirected URL of a URL in Java
Learn how handling redirection correctly is essential for building robust web applications that interact with external resources.
PrintWriter write() vs print() Method in Java
Discover the differences between PrintWriter’s write() and print() methods.
Polymorphism with Gson
A quick and practical guide to handling polymorphic structures with Gson.
Install Java on macOS
Learn how to install Oracle JDK via DMG package and OpenJDK via Homebrew package manager
Intro to the Apache Commons Compress Project
In this tutorial, we explore Apache Commons Compress, a library for file compression, archiving, and extraction. It supports various formats like TAR, ZIP, GZIP, BZIP2, and more.
Set Matrix Elements to Zero in Java
In this tutorial, we learn various approaches to setting a matrix’s entire row and column to zero if one of the elements is zero.
New Features in Java 21
Learn about the new features of Java 21, like record patterns and switch enhancements for cleaner code.