Learn that using either field declaration or constructor initialization is more of a preference.
Search Results for: constructor declaration
Difference Between Lombok @AllArgsConstructor, @RequiredArgsConstructor and @NoArgConstructor
Learn about different constructor generation annotations in Lombok and when to use them.
Constructor Specification in Java
Learn the rules that Java language specified for the declaration of a constructor
Generic Constructors in Java
Learn how to use generic constructors in both generic and non-generic Java classes.
Guide to the Diamond Operator in Java
A quick and practical guide to the diamond operator that was introduced in Java 7.
Capturing Method Arguments When Running Spock Tests
Learn how to capture method arguments using Spock’s Stubs, Mocks, and Spies using Closures.
OpenAPI Generator Custom Templates
Learn how to use OpenAPI Generator Custom Templates to generate customized client and server code from REST API definitions.
Implementing GraphQL Mutation Without Returning Data
Explore techniques for implementing GraphQL mutations without retrieving or returning specific information.
Static Final Variables in Java
In this tutorial, we learn how to declare and initialize constant variables.
All the Ways Java Uses the Colon Character
Learn how Java uses the colon character in a variety of different ways.
Synchronize a Static Variable Among Different Threads
Learn several ways to synchronize access to static variables among different threads.
Implementing toString() on enums in Java
Different ways of implementing toString for enums.
Record vs. Final Class in Java
Explore the differences between records and final classes in Java.
Initialize an ArrayList with Zeroes or Null in Java
Learn the alternatives when we need to initialize an ArrayList with null or 0 values.
Uploading a File and JSON Data in Postman
Learn how to upload files and JSON data when using Postman.
Channels and Connections in RabbitMQ
Explore Channels and Connections in RabbitMQ and how we can use them.
Declaring Val and Var Variables in Lombok
Learn how to use Lombok’s val and var to define local variables without specifying the type.
LDAP Authentication Using Pure Java
Learn how authentication works in built-in LDAP
Spring Security – Request Rejected Exception
Explore Spring Security’s protection against malicious URLs that may cause the Path Traversal/Directory Traversal attacks.
Using an Interface vs. Abstract Class in Java
Learn when to use an interface and when to use an abstract class in Java.