Take a look at the different ways to initialize primitives and objects in Java.
Search Results for: Creating Java Objects
How to Use Pair With Java PriorityQueue
Learn how to use Comparators with PriorityQueues and how to change the sorting order in such queues.
Convert From int to short in Java
Learn how to convert from an int primitive to a short primitive in Java.
Converting Image to BufferedImage in Java
A quick and practical guide to converting images to BufferedImage in Java.
Implement the Builder Pattern in Java 8
Learn how to implement a Builder Pattern in Java 8.
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.
Create and Run Apache JMeter Test Scripts via Java Program
Learn how to create and execute Apache JMeter test scripts programmatically using the JMeter Java API.
Multiple-Level Mock Injection Into Mockito Spy Objects
Learn how Mockito annotations work in multiple-level injection scenarios.
When to Use Setter Methods or Constructors for Setting a Variable’s Value in Java
Learn when to use setter methods or constructors for setting the value of a variable in Java.
Creating PostgreSQL Schema Before Liquibase Execution
Learn how to create a PostgreSQL schema before Liquibase execution in Spring Boot.
Serialization with FlatBuffers in Java
Explore the FlatBuffers library and its capabilities to serialize and deserialize complex data.
Create JavaType From Class with Jackson
Learn how to build instances of JavaType from Class objects with the help of the Jackson library.
Mutable vs. Immutable Objects in Java
Learn more about the definitions, examples, advantages, and considerations of mutable and immutable objects in Java.
Structured Logging in Java
Learn the advantages of and how to implement structured logging in Java.
Convert Null Value to a Default Value in Java
Learn how to convert null value to a default value in Java.
Rotating a Java String By n Characters
Explore two different approaches to rotating a string by n characters.
Deserializing JSON to Java Record using Gson
Learn how to dеsеrializе JSON data into Java rеcords using Gson.
Working With HarperDB and Java
Discover Java’s support for HarperDB, a high-performing flexible NoSQL database with the power of SQL.
Limiting the Max Size of a HashMap in Java
In this tutorial, we learn how to limit the number of entries in a HashMap.
Context-Specific Deserialization Filters in Java 17
Explore Java’s latest enhancement, Context-Specific Deserialization Filter (JEP 415), in action.